Hello everyone,
I am using VSTS 2008 + C# + .Net 3.5 + ASP.Net + IIS 7.0. And I am implementing Forms authentication.
I want to know in Forms authentication, how to check whether a user is already authenticated or not?
thanks in advance, George
Hello everyone,
I am using VSTS 2008 + C# + .Net 3.5 + ASP.Net + IIS 7.0. And I am implementing Forms authentication.
I want to know in Forms authentication, how to check whether a user is already authenticated or not?
thanks in advance, George
Hi,
You can use HttpContext.Current.User.Identity.IsAuthenticated
to check whether they're authenticated. For example
if(User.Identity.IsAuthenticated)
{
Response.Write("Logged in already");
}
else
{
Response.Write("Please log in");
}