NZ Jimmy
2010-06-22 22:49:13 UTC
I have a page in an ASP.NET web application that includes an external
javascript file using a fairly basic script tag:
<script src="DispatchRuleControl.js" type="text/javascript"></script>
When running the application on the ASP.NET internal webserver everything
works fine. When I try to host it on IIS7 however I get a syntax error in
that *.js file and, upon closer inspection (using firebug) it appears that
under IIS 7 what is returned is not the contents of the
DispatchRuleControl.js file at all but instead the fully rendered Login page
for the ASP.NET web appliction...
So essentially it seems that access to that file is being denied by IIS 7...
this causes ASP.NET to redirect to the login page and return this instead of
the *.js file, which in turn causes the syntax error (the login page is not a
valid javascript file)... but the root cause is that IIS is blocking access
to this file for some reason.
I can confirm this by entering the URL of the javascript file in the address
bar for firefox/ie directly... I get sent straight to the following URL:
http://localhost:8000/Login.aspx?ReturnUrl=%2fCMS%2fAdmin%2fDispatchRuleControl.js
Which is, of course, the login page for the site. After logging in, the
login page then redirects to the ReturnUrl (seen in the Query string above)
and that in turn goes straight back to the login page... it's impossible to
get the contents of this js file served up by IIS 7 - it's blocking access to
it outright.
Any idea why this might be or how I can debug further?
Thanks in advance.
Jimmy
javascript file using a fairly basic script tag:
<script src="DispatchRuleControl.js" type="text/javascript"></script>
When running the application on the ASP.NET internal webserver everything
works fine. When I try to host it on IIS7 however I get a syntax error in
that *.js file and, upon closer inspection (using firebug) it appears that
under IIS 7 what is returned is not the contents of the
DispatchRuleControl.js file at all but instead the fully rendered Login page
for the ASP.NET web appliction...
So essentially it seems that access to that file is being denied by IIS 7...
this causes ASP.NET to redirect to the login page and return this instead of
the *.js file, which in turn causes the syntax error (the login page is not a
valid javascript file)... but the root cause is that IIS is blocking access
to this file for some reason.
I can confirm this by entering the URL of the javascript file in the address
bar for firefox/ie directly... I get sent straight to the following URL:
http://localhost:8000/Login.aspx?ReturnUrl=%2fCMS%2fAdmin%2fDispatchRuleControl.js
Which is, of course, the login page for the site. After logging in, the
login page then redirects to the ReturnUrl (seen in the Query string above)
and that in turn goes straight back to the login page... it's impossible to
get the contents of this js file served up by IIS 7 - it's blocking access to
it outright.
Any idea why this might be or how I can debug further?
Thanks in advance.
Jimmy