Determine UserID on same page as login request (after postback)

Discussion in 'ASP .Net' started by Ash, Nov 28, 2003.

  1. Ash

    Ash Guest

    I want to provide the ability for my users to login from any page that they
    are on. ie. have a login user control with a username and password box on
    each page (not a link to a login page).

    However, as the values of other controls on the page , and whether these
    controls are displayed, rely on whether the user is logged in, I need to get
    the UserID before the controls are created.

    I suppose that I could set these properties in the PreRender event of the
    page, but how can I determine whether certain controls, or controls within
    those controls, are created.

    Because the server-side control events are fired after the
    CreateChildControls method is invoked, I can see no way to access the UserID
    unless I post the login request to a different page (not recommended,
    passing passwords between pages), and then transfer back to the original
    page. In this case, I would also need to preserve the Viewstate of the
    original page (I'm not sure how: Session variable? Querystring?).
     
    Ash, Nov 28, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. A.M
    Replies:
    2
    Views:
    495
    Steven Cheng[MSFT]
    Jul 29, 2004
  2. tshad
    Replies:
    12
    Views:
    4,786
    tshad
    Nov 2, 2004
  3. Hardy Wang
    Replies:
    1
    Views:
    2,994
    Nicholas Paldino [.NET/C# MVP]
    Dec 5, 2005
  4. Pascal Blanchard
    Replies:
    0
    Views:
    258
    Pascal Blanchard
    Aug 17, 2004
  5. Pascal Blanchard
    Replies:
    1
    Views:
    293
    Pascal Blanchard
    Aug 18, 2004
Loading...

Share This Page