I made a web application which displays Windows User Name on top right.
If I open the webapp on localhost:5903/index.aspx
I get correct Windows User.
Like this -
But if I open localhost/db/index.aspx
I get IIS AppPool User -
Here db is the directory which has my app.
I have no idea why is this happening. I want the localhost to show the correct Username as well.
My IIS tree, here DB(1) is my webapp -
My C# code which picks Windows Identity -
<li><% string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;%>
<a><%= userName %></a>
</li>