Trying to understand IIS7 and ASP.NET (4.5, Visual Studio 2012)

mdProgrammer

New member
Joined
Aug 2, 2005
Messages
3
Programming Experience
10+
Not sure if this is more of an IIS7 issue, or ASP.NET issue.

I have an application which is using Windows Authentication. When I start it, it opens up as "http://localhost:<some port number>/default.aspx. In previous versions of asp.net (1.1) and IIS6, it would show something like "http://localhost/webdirectory/default.aspx". Is there something I should set up to make it always use the webdirectory?

Also, this leads to my 2nd problem. For testing, I put in "response.write(user.identity.name)" in the Page_Load event. This works fine when the website is "http://localhost:<port number>/default.aspx", but when I go to "http://localhost/WebDirectory/default.aspx", the user.identity.name result doesn't show. Why isn't it working?
 
Ok, I figured out what was wrong (kind of).

First, the application uses "IIS Express" by default. I had to set this to "Use Local IIS".
Second, in the IIS Manager, I had to open "Authentication" --> Enable Windows Authentication --> Select Providers --> Move NTLM to the top, then it worked, at least for a test application. For an existing one, it still doesn't show the logged in Windows user.
 
Last edited:
Back
Top