How to get the list of login ID(Asp.Net2.0)

A

ad

I use Login control to authenticate use.
How to get the list of user ID who have login in?
 
B

Brock Allen

The Login has a Username property that you can access in the Authenticate
event. On other pages you can simply use User.Identity.Name.
 
A

ad

Thanks,
Besides the the user just login, I also want to know all the usrs on line.
How can I get the list of all users on line?
 
J

Juan T. Llibre

Identify and log each user into a database as they start to
view the site, and log them out when their sessions time out.
 
B

Brock Allen

There's Membership.GetNumberOfUsersOnline, but oddly enough there's no Membership.UsersOnline.
Unfortunately you'll have to break encapsulation and do a select against
the tables that are storing this information. Those will vary depending upon
the membership provider.

You could also do as Juan suggests and maintain this information yourself
in your own database. Personally, I'd opt for this approach.
 

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,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top