Hi
I'm new to ASP.NET (from classic ASP) and wasn't aware of the Forms
Authentication security when I started working on a website. So I
built a login page that stores a CustomUser object in the Session, and
then I put a login check in the Master Page codebehind, Page_Load
event, which redirects to the Login.aspx if the login check fails.
I realise NOW that I should have gone th Forms Authentication (using
web.config) route, but I dont have the time to change this now - I
have to deliver the website today. I can come back later and change
this.
So FOR THE TIME BEING, how can I get my custom security system to
work?
The problem is, I have just put some code that uses the Sessions
CustomUser object - into the Page_Load event on one of my access-
restricted pages. But now I see that the Page_Load event of the
content page fires BEFORE the Master page login check. I tried moving
the login check to the Init event of the Master Page, but the content
page's Page_Load event still got executed.
So I guess what I'm asking is, how do I (and where do I) add code that
can check a Session object, and can then redirect the user WITHOUT
executing the rest of the Page_Load (or any other such events)?
Much appreciated.
Sean
Peter Bromberg [C# MVP] - 14 Mar 2008 12:24 GMT
Sean,
This belongs in the ASP.NET newsgroup, you're posting it in the C# language
group.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net
> Hi
>
[quoted text clipped - 25 lines]
> Much appreciated.
> Sean