How to Display The Windows Login ID in ASP.NET

10 pts.
Tags:
ASP.NET 3.5
Windows Security
We are developing an ASP.NET 2.0/3.5 application that needs to display the logged in Windows Userid of the user. Is there a method that we can use that will allow us to determine this information ?

Software/Hardware used:
IIS ASP.NET

Answer Wiki

Thanks. We'll let you know when a new response is added.

If you are using Active Directory membership provider, and have disabled anonymous access in IIS, you could use this to get the user name:

<pre>myUserName = Page.User.Identity.Name</pre>

More information on the AD provider:
<a href=”http://msdn.microsoft.com/en-us/library/ms998360.aspx”>How To: Use Forms Authentication with Active Directory in ASP.NET 2.0</a>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: