I’m working in MVC 3 with C#. I’m working on security trimming. I’m obviously implementing it through a sitemap. My question is can I pass the user’s current user name to the sitemap? My goal is to have an “account” link that has text equal to the user’s user name. Right now my sitemap code looks like:
<siteMapNode title="Account" description="Account settings" url="~/Account" />
This code is nestled correctly and everything is fine. I just want to know how to make the title section update dynamically and match the user’s username. Is this possible?
Additional information: all trimming is done through the code expressed in this article. Additionally, this is my sitemap string:
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
Profiles are done through ASP .NET SQL Profile/Role Provider. Thanks in advance.
HttpContext.Current.User if not null