Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Lifecycle question regarding master pages

Reply
Thread Tools

Lifecycle question regarding master pages

 
 
=?Utf-8?B?ZHNvcnJlbGw=?=
Guest
Posts: n/a
 
      09-13-2007
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?
 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      09-13-2007
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)

dsorrell wrote:
> 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?

 
Reply With Quote
 
 
 
 
=?Utf-8?B?ZHNvcnJlbGw=?=
Guest
Posts: n/a
 
      09-14-2007
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.

"bruce barker" wrote:

> 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)
>
> dsorrell wrote:
> > 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?

>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Master Page lifecycle =?Utf-8?B?bWdvbnphbGVzMw==?= ASP .Net 1 07-05-2006 07:03 PM
Master Page Lifecycle (note) =?Utf-8?B?bWdvbnphbGVzMw==?= ASP .Net 0 07-05-2006 04:04 PM
Cross Page Post Back When Using Mixture of Master Pages and Non-Master Pages Jason@webbit.com ASP .Net 1 05-16-2006 02:00 PM
Master Pages Great! But what about Master User Controls? Electrified Research ASP .Net 5 10-11-2005 02:32 PM
seeking servlet "Master" keep getting "Master/servlet/Master" not found. Tomcat 5.0.25 Doug McCann Java 1 08-05-2004 09:16 PM



Advertisments