Lifecycle question regarding master pages

Discussion in 'ASP .Net' started by Guest, Sep 13, 2007.

  1. Guest

    Guest 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?
     
    Guest, Sep 13, 2007
    #1
    1. Advertisements

  2. Guest

    bruce barker Guest

    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)
     
    bruce barker, Sep 13, 2007
    #2
    1. Advertisements

  3. Guest

    Guest 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.
     
    Guest, Sep 14, 2007
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.