I am in the process of releasing a couple of asp.net websites from development to production. Everything seems to be working fine in development, but upon the release to production we get a number of javascript errors when accessing the site. This appears to be something on the server though as this same code has been deployed to a testing server and works fine with the same clients. The server is a Windows 2008 using IIS7
Errors being thrown:
An number of syntax errors (scriptResource) - 10 of these
Error: syntax error
Source File: http://website.com/ScriptResource.axd?d=abc032_vah79hasdf87&t=123456789
Line: 3
Source Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Error the same as above but with WebResource.axd instead of ScriptResource.axd - 2 of these
and then two that seem to be the real cause?
Sys is not defined
and
WebForm_AutoFocus is not defined
----------------- Addendum --------------------
As per suggestions I looked into the ScriptResource.axd and WebResource.axd
The web application being deployed has forms authentication and re-directs to the login page if any page is referenced other than the login page. It appears that this is happening with the ScriptResource.axd and WebResource.axd (i.e. login page tries to reference those items, redirection happens so they don't get the javascript back, errors are thrown)
To that end I added "location" tags to the web.config to try and allow all users through to those items, so the login page would work (see relevant web.config sections below)
<system.web>
<authentication mode="Forms">
<forms loginUrl="login.aspx" defaultUrl="home.aspx"/>
</authentication>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
...
</system.web>
<location path="ScriptResource.axd">
<system.web>
<authorization>
<allow users="*"/>
<!-- allow all users -->
</authorization>
</system.web>
</location>
<location path="WebResource.axd">
<system.web>
<authorization>
<allow users="*"/>
<!-- allow all users -->
</authorization>
</system.web>
</location>
This unfortunatly has not solved the problem either. Is there some setting/configuration option that stops the location tag from working? We've added the same tags for pages in the application (to test) and it works on the developers machine, but not the server. It looks like if we could just get these location tags working on the server everything would work, any suggestions?