master page needs to validate before child page

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
 
M

Mark Rae

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top