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

A

Ash

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?).
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top