Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to change the label Login to Logout [placed in masterpage ] after login in the application
and also want to change the hyperlink of teg a.

Login form is in Content Page..
C#
<div class="menu""> 
	<ul>
	<li class="login"><a href="Login.aspx"><asp:Label ID="lblLogin" runat="server" Text="Login"></asp:Label></a></li>
        <li class="reg"><a href="Register.aspx"><asp:Label ID="lblRegister" runat="server" Text="Register"></asp:Label></a></li>
    </ul> 
</div>


-I have placed this code in Master page
-But i need to change the Text of labels when the user login on a child page. I am unable to do because the content is in master page and remain same in all other pages.


pls help me.....
Posted

 
Share this answer
 
C#
((Label)Master.FindControl("lblHeading")).Text = "Logout";

((Anchor)Master.FindControl("ancLogin")).href= "../Logout.aspx";
 
Share this answer
 
 Label masterlbllogin = (Label)Master.FindControl("lblLogin");
masterlbllogin.Text = "change text..."

 Label masterlblRegister = (Label)Master.FindControl("lblRegister");
masterlblRegister .Text = "change text..."
 
Share this answer
 

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