asp.net - Check Panel to enable/disable visibility -
In case of both of these enable / disable for both of them I feel "hami". Since one of them had already been "turned on" so I have to shut them down again or I feel like I can dodge one of the checks:
Private Zero SetPanels (if (userIsLoggedIn) {pnlAuthed.Visible = true; PnlNotAuthed.Visible = false;} and {pnlSignUpForm_NotAuthed.Visible = true; PnlSignUpForm_Authed.Visible = false;}}
I think you are looking for something like this:
pnlAuthed.Visible = userIsLoggedIn; PnlNotAuthed.Visible =! UserIsLoggedIn; PnlSignUpForm_NotAuthed.Visible =! UserIsLoggedIn; PnlSignUpForm_Authed.Visible = us ErIsLoggedIn;
Comments
Post a Comment