I have an application which relies on session variables to work properly. I have code which checks to see if the session values exist, if they do not redirects them to the login page so they can re-log in. (They have most likely timed out).
I use usercontrols on most but not all of the pages.
The code does not always work. I COULD call it from every event that could cause a postback but then I'd need to remember that. I have tried putting it in the page_load but it does not always work there.
I have tried putting it in the page_load of the controls as well, but it does not always work there either.
When you have a page which has multiple usercontrols, and a postback occurs what is the order of operation? Does the 'page' execute first and then the controls (So I should find the right place at the page level) or does the control execute first?
Where should I call this routine from, or do I have to remember to call it from all possible post back operations (ie: button presses, controls that cause post back etc.)
Ask One/Answer One.