Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to use 'MsgBox(User.Identity.Name)' to show the Current Windows User in a MessageBox. The MessageBox that appears shows "App_Web_1gu0lxe5" as the Title and Message is Empty. In other words I am not able to get the Current Windows User in the Output.

I am using Windows 8.1 Enterprise, 64-bit Operating System, Microsoft Visual Studio 2012, Visual Basic is the Programming Language and I am trying to develop a Web Application.

When I am running the same code on a Machine running "Windows 7 Enterprise, Service Pack 1, 64-bit Operating System" the code produces the desired result.

Any Idea what could be the cause of the Problem?
Posted
Comments
Sanket Saxena 25-Dec-14 8:13am    
Did you host the site on IIS? If yes then did you make all the settings proper in IIS to manage the Windows Authentication?
syed shanu 25-Dec-14 19:20pm    
Check this links hope this will help you.
is your Authentication Mode="Windows" ?
http://forums.asp.net/t/1751160.aspx?string+sName+HttpContext+Current+User+Identity+Name+ToString+Not+working

http://codeverge.com/asp.net.security/user.identity.name-doesn-t-work-on-server/54092

http://www.codeproject.com/Questions/365520/IIS-Setting-to-get-Current-User-Name-in-ASP-Net

1 solution

MsgBox is not something that will work in ASP.Net. You need to enable Windows Authentication to be able to get that user name.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900