How can you test whether the Windows user is authenticated?

 Posted by Ddd on 3/16/2011 | Category: ASP.NET Interview questions | Views: 2311 | Points: 40

It can be done by using this code snippet

Write it in an event handler (Page_Load for example)

   if (User.Identity.IsAuthenticated == true)

Response.Write(User.Identity.Name + "---" + "authenticated");

It will display the Windows user name if authenticated

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Akiii on: 3/17/2011 | Points: 10

Tested and working fine.....

Thanks and Regards

Login to post response