LoginStatus Dynamic Visiblity not working
-
I have placed the Login, and LoginStatus in the MasterPage. I have set LoginStatus to false by default. Once the user has logged in, I want the LoginStatus to become True. I have tried the following code and it's not working. I tried to run the debugger and check if the code behind runs, and I haven't seen that it did. Seems that it just skips the code. Thank you for your time. MasterPage.Master MasterPage.Master.cs protected void LoggedIn(object sender, EventArgs e) { LoginStatus1.Visible = true; }
-
I have placed the Login, and LoginStatus in the MasterPage. I have set LoginStatus to false by default. Once the user has logged in, I want the LoginStatus to become True. I have tried the following code and it's not working. I tried to run the debugger and check if the code behind runs, and I haven't seen that it did. Seems that it just skips the code. Thank you for your time. MasterPage.Master MasterPage.Master.cs protected void LoggedIn(object sender, EventArgs e) { LoginStatus1.Visible = true; }
I think the MasterPage.Master runs that line <asp:LoginStatus visible="false" CssClass="menu" ID="LoginStatus1" Font-Underline="true" runat="server"/> again. I would prefer using a session to store the login status On the MasterPage.Master Page_Load event, do a check on the status of the Session("loginstatus") so if it's "1" then visible = true if it's "0" then visible = False. Henceforth, and your Login_Authentication you can check if user login success then chagne your session to "1" =) Cheers hope this helps you~