How to pass username in the login control to next page?

K

kai

Hi, All
I have VB 2005, I use login control to logn in, after log in, I go to
another page. I want to use the login username in another, how to use
session varible to pass the username?

I use the following code, but I cannot login:


Protected Sub Login1_Authenticate1(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.AuthenticateEventArgs)

Session("username") = Login1.UserName

End Sub


Please help
Thanks
Kai
 
M

Mark Fitzpatrick

After a user is logged in they should be authenticated. This means you would
access their username through their authentication typically. Try using
Page.User.Identity.Name
 
K

kai

Thanks Mark.

Kai

Mark Fitzpatrick said:
After a user is logged in they should be authenticated. This means you
would access their username through their authentication typically. Try
using Page.User.Identity.Name
 

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,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top