I am trying to create a menu item within my web app that sets the parent node to the username of the current user logged into the website. the child nodes will all be the same incontext.
Currently I have been trying to write out the user name using <% Page.User.Identity.Name.ToString(); %>
However I have found that once the user logs into the site this value stays null.
Below is the entire code block I have been playing with. You'll notice the loginName control is still in place (for testing)
<asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false">
<AnonymousTemplate></AnonymousTemplate>
<LoggedInTemplate>
<div class="loginDisplay">
Welcome
<% Page.User.Identity.Name.ToString(); %>
<asp:LoginName ID="HeadLoginName" runat="server" /> |
<asp:LoginStatus ID="HeadLoginStatus" runat="server"
LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/" />
</div>
</LoggedInTemplate>
</asp:LoginView>
My hope is to have a menu item that looks like
Username ( parent node) + menu item 1 (child node) + menu item 2 (child node)
Using the above approach may not even be correct so I would really appreciate any suggestions, or comments for more efficient approaches as well.
Thanks in advance