asp.net mvc, IIS 6 vs IIS7.5, and integrated windows authentication causing javascript errors?

Posted by chris on Stack Overflow See other posts from Stack Overflow or by chris
Published on 2010-06-11T17:44:34Z Indexed on 2010/06/12 19:32 UTC
Read the original article Hit count: 769

Filed under:
|
|
|
|

This is a very strange one.

I have an asp.net MVC 1 app. Under IIS6, with no anon access - only integrated windows auth - every thing works fine. I have the following on most of my Foo pages:

  <% using (Html.BeginForm())
     { %>
  Show All:
  <%= Html.CheckBox("showAll", new { onClick = "$(this).parent('form:first').submit();" })%>
  <% } %>

Clicking on the checkbox causes a post, the page is reloaded, everything is good.

When I look at the access logs, that's what I see, with one oddity - the js library is requested during the page first request, but not for any subsequent page requests. Log looks like:

GET / 401
GET / 200
GET /Content/Site.css 304
GET /Scripts/jquery-1.3.2.min.js 401
GET /Scripts/jquery-ui-1.7.2.custom.min.js 401
GET /Scripts/jquery.tablesorter.min.js 401
GET /Scripts/jquery-1.3.2.min.js 304
GET /Scripts/jquery-ui-1.7.2.custom.min.js 304
GET /Scripts/jquery.tablesorter.min.js 304
GET /Content/Images/logo.jpg 401
GET /Content/Images/logo.jpg 304

GET /Foo 401
GET /Foo 200
POST /Foo/Delete 302
GET /Foo/List 200
POST /Foo/List 200

This corresponds to home page, click on "Foo", delete a record, click a checkbox (which causes the 2nd POST).

Under IIS7.5, it sometimes fails - the click on the check box doesn't cause a postback, but there are no obvious reasons why.

I've noticed under IIS7.5 that every single page request re-issues the requests for the js libraries - the first one a 401, followed by either a 200 (OK) or 304 (not modified), as opposed to the above log extract where that only happened during the 1st request.

Is there any way to eliminate the 401 requests? Could a timing issue have something to do with the click being ignored? Would increasing the number of concurrent connections help? Any other ideas? I'm at a bit of a loss to explain this.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about asp.net-mvc