views:

247

answers:

2

When using Visual Studio's built in web server, every time I make a page request the standard login box pops up and asks for credentials. It doesn't work if I actually put in my credentials, so I just have to hit cancel 5 times so it will go away.

When I run the application through IIS (locally or on test server) it works just fine (no login box comes up).

Anyone know how to fix this or have any idea what might be causing it?

+1  A: 

I assume you mean JavaScript alert box-looking login dialog, right? This dialog pops up when you make a request to a portion of website where anonymous access is disabled from IIS. It is different from ASP.NET authentication.

Do you have some portion of web site protected? Or are you making any HTTP request to external sites, like images and etc?

If your page looks ok after hitting cancel multiple times, it must be one of those HTTP request to protected file like images, css, js or whatever.

I'd look in Fiddler or Firebug to see if any request is failed when you hit cancel in that login dialog.

I'd also try clearing cache/authenticated session on the page that runs on IIS to see if it actually shows you that login dialog.

Brian Kim
It happens on all pages. on every app. Blank pages even (I believe)... I'll double check that when I get back
Max Schmeling
On every app? That's odd...
Brian Kim
But your pages show up correctly after you cancel all the login dialogs?
Brian Kim
Yes. Everything looks and works perfectly except for the fact that the login box comes up 5 times first
Max Schmeling
A: 

This was because localhost was not in my trusted sites so it wouldn't do automatic NTLM authentication... I'm not sure why it was that way, but it was... adding localhost to the list fixed it.

Max Schmeling