Lifecycle question regarding master pages


G

Guest

I've been having a recurring issue with master page authentication. Right
now, I have verification code in the Page_Init event of the master page,
which checks the Page.User object to make sure the Membership object is still
alive. If not, it redirects to the login page. If so, it lets the user see
whatever page they were after. My issue is that it seems sometimes this event
doesn't fire when it's supposed to, and I'll get "object refrence not set to
an instance of an object" errors specifically on the call for the User object.

Anybody know how to fix this problem?
 
Ad

Advertisements

B

bruce barker

the master page is a control on the actual page. this means its oninit
fires when other page controls fire, not necessarily first.

you validation code should probably be in BeginRequest in the
application object.


-- bruce (sqlwork.com)
 
Ad

Advertisements

G

Guest

The problem with that is that there are three different areas that require
different authentication... each area has its' own master page checking to
make sure the user object is in the right group to be viewing that part of
the website.
 

Top