c# - Invisible controls still being rendered -


I'm having a strange problem.

I have two placeholders in the master page; These include controls for users logging out and other controls for logged-in users.

They are:

plhLoggedOut

plhLoggedIn

my page_load ( Master page), I set their visibility in this way:

  // LOGGED-in? PlhLoggedOut.Visible = (app.UserID == 0); PlhLoggedIn.Visible = (app.UserID! = 0);  

However, the contents of both placeholders are still being provided.

I am also writing my position for a status message, and this status message confirms that only one appears at any time eg,

  PlhLoggedOut.Visible == True; 

Any idea how it might be (and how to decide it)?

Much more thanks,

Michael

Maybe your Elsewhere in the code, you are setting the parental control of those panels in visible, all the children and sets them visible as well. You need to change your code so that plhLoggedOut and plhLoggedIn visibility after their parent control Is set.


Comments