Click here to Skip to main content
15,921,250 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
MY code :

HTML
<div class="mmenu">
<asp:Menu ID="Menu1" runat="server" Orientation="Horizontal">
<staticmenuitemstyle horizontalpadding="7px" />
<items>
<asp:MenuItem Text="Home" NavigateUrl="~/Home.aspx">
<asp:MenuItem Text="Gallery" NavigateUrl="">
<asp:MenuItem Text="Login" NavigateUrl="~/UserLogin.aspx">
</items>
<asp:Menu></div>
Posted
Updated 20-Apr-14 9:13am
v2

C#
Menu1.Items[2].Text = "Logout";
 
Share this answer
 
v3
Comments
Manas Bhardwaj 20-Apr-14 15:22pm    
Ditto. +5!
Thanks Manas. :)
One way is to do it in CodeBehind on the page load and check via session (or whatever) that the user is already logged in.

C#
if(alreadyLoggedIn)
{
    Menu1.Items[2].Text = "Logout";
    Menu1.Items[2].NavigateUrl = "~/UserLogOut.aspx";
}


Another alternative would be do it via the client side using jQuery.
 
Share this answer
 
Comments
Take my 5. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900