How to Find If User Is Logged In?
If your web application uses membership, then you need to know if web request is authenticated or not. To find is user currently logged in use this code:
[ C# ]
// To check if user is logged in use
// IsAuthenticated property
// User is logged in
// Anonymous request
[ VB.NET ]
' To check if user is logged in use
' IsAuthenticated property
If (Context.User.Identity.IsAuthenticated) Then
' User is logged in
' Anonymous request
On the same way, you can also use Request.IsAuthenticated method instead of User.Identity.IsAuthenticated.
1. User registration and authentication for an ASP.NET 2.0 webs
2. How to Logout User in ASP.NET Membership?
3. How to Show User Name of Currently Logged User?