master page needs to validate before child page

  • Thread starter Thread starter enantiomer
  • Start date Start date
E

enantiomer

I am using my master page to always make sure that the User object is
not null in Session. If it is null, I redirect them to the login page.
Some of my child pages utilize the User object. I was assuming that
the master page Page_Load would be called before ChildPage_Load
methods, but it is the opposite. Is this normal?

I need something to check that my User Session isn't null before the
page loads. Any advise? Thanks,

Jonathan
 
I am using my master page to always make sure that the User object is
not null in Session. If it is null, I redirect them to the login page.
Some of my child pages utilize the User object. I was assuming that
the master page Page_Load would be called before ChildPage_Load
methods, but it is the opposite.

That's right.
Is this normal?
Yes.

I need something to check that my User Session isn't null before the
page loads. Any advise? Thanks,

Use the Page_Init event in your MasterPage
 
Back
Top