user access through multiple pages

Last post 10-02-2007 1:37 PM by spinz2112. 2 replies.

Sort Posts:

  • user access through multiple pages

    10-01-2007, 1:40 PM
    • Member
      213 point Member
    • spinz2112
    • Member since 10-11-2006, 1:05 PM
    • Dallas, TX
    • Posts 207

    I have kinda a newbie question. Once a user has logged in from say a login page and is then redirected to a new page with menus etc. and these are all supposed to be secured pages, is it common practice to check if you have a logged in user accessing the page on the page_load directive? If so, how would you usually go about doing this?

    Thanks

    You are so wise...like a miniature budha covered in fur. -Anchorman
  • Re: user access through multiple pages

    10-01-2007, 5:03 PM
    Answer
    • Contributor
      4,300 point Contributor
    • jackyang
    • Member since 11-16-2006, 7:27 PM
    • Waterloo, Canada
    • Posts 587

    User is authenticated on the event Application_AuthenticateRequest event ref: http://msdn2.microsoft.com/en-us/library/ms993239.aspx, so use the logged-in user check whereever in the events after that. It's very early in the page life cycle, so you've got lots rooms to play.

    Common practice or not for doing such inside Page_Load event is really depend what you wanted to do with the different state of the user's logged-in status. If you want to dynamically switch the nested master pages based on the status, you can only do it in the On_Init event.

    In terms of how to apply it, here's a tutorial: http://msdn2.microsoft.com/en-us/library/ms972109.aspx

     

    Jack Yang
    .NET Developer
  • Re: user access through multiple pages

    10-02-2007, 1:37 PM
    • Member
      213 point Member
    • spinz2112
    • Member since 10-11-2006, 1:05 PM
    • Dallas, TX
    • Posts 207

    most of the stuff in the above links related to older .net frameworks like .net 1 and 1.1. Im not so sure if it relates to .net 2.0 and 3.0.

    You are so wise...like a miniature budha covered in fur. -Anchorman
Page 1 of 1 (3 items)