J
Jonathan Wood
I have a webform that alters it's content depending on whether or not the
current user is logged in. It does this in the Page_Load event.
My master page has a logout button. If the user clicks this button, it fires
the Page_Load event in my content page, the Page_Load event in my master
page, and finally the Logout_Click event for my logout button.
This means that my code that alters the page (depending on whether or not
the current user is logged in) fires before the code that logs the user out.
This results in serving a page for a logged-in user when they are now logged
out.
I'm not sure how best to handle this. My page has a lot of initialization
code that I do not want to run twice. If it's a postback, I need to delay my
initialization code somehow until after the Logout_Click event has executed
on the master page.
I welcome any helpful suggestions.
Jonathan
current user is logged in. It does this in the Page_Load event.
My master page has a logout button. If the user clicks this button, it fires
the Page_Load event in my content page, the Page_Load event in my master
page, and finally the Logout_Click event for my logout button.
This means that my code that alters the page (depending on whether or not
the current user is logged in) fires before the code that logs the user out.
This results in serving a page for a logged-in user when they are now logged
out.
I'm not sure how best to handle this. My page has a lot of initialization
code that I do not want to run twice. If it's a postback, I need to delay my
initialization code somehow until after the Logout_Click event has executed
on the master page.
I welcome any helpful suggestions.
Jonathan