Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

.NET custom security: still possible?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
plugwalsh@yahoo.com - 14 Mar 2008 08:15 GMT
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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.