Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. LoginStatus Dynamic Visiblity not working

LoginStatus Dynamic Visiblity not working

Scheduled Pinned Locked Moved ASP.NET
debugging
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Albert83
    wrote on last edited by
    #1

    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; }

    S 1 Reply Last reply
    0
    • A Albert83

      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; }

      S Offline
      S Offline
      saberbladez
      wrote on last edited by
      #2

      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~

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups