Request.LogonUserIdentity.Name returns asp.net server credential not the users credetials
I am building a开发者_StackOverflow simple intranet site and want to get the employees user name, but when i use Request.LogonUserIdentity.Name , i keep getting the servers credentials and not the users. what am i doing wrong and is there a better way to do this.
You can set the authentication mode to "Windows":
<authentication mode="Windows"/>
Then, in your code, use Me.User.Identity.Name
to get the user's login id.
Note that this is an ASP.NET 2.0 for Visual Studio 2005 example. It may have changed if you are using something older or newer.
ASIDE EDIT: Why does the main page show this topic as being posted 51 minutes ago, but I just now see it's from Feb!?!?!?
精彩评论