Monday, December 6, 2010

IIS 7.5 WebResource.axd and ScriptResource.axd not found

Last week i deployed a web application on a new server. the site was containing wordpress blog and posting, when i took the web online i observed that my AJAX toolkit is not working. so i started debugging the problem. after spending couple of days and 30 hours i concluded that it is due to some handler which is not allowing the runtime files to be shown because each time i try to browse a webresource it throw 404 page not found. i was using Windows server 2008 R2 so i observed in the handler that each request which blongs to a web resouce which does not exists is actually routed to php/wordpress engine. who then evalute this request as valid or not so it was my issue. some people suggested that i have to use static url path for web resource which was not possible due to extensive change. so this was the issue
script src="/ScriptResource.axd?d=6jlaIZUKRXg3wAiiwb5CXRLLE4-Gm23NRJYO6UGKsEfKVWmmRDjpjYUxUQc3rzA15AxvjFMTyyBHnHZwnp436Rh4PelOuGVzY5dYg0oEc1rFylLCCtLPLtzdaF9l9sPZW6Nu8_s0HdGhCknizdMILSk85R81&t=634213836780000000" type="text/javascript".
many solution like these
http://stackoverflow.com/questions/3822733/ajaxtoolkit-iis7-asp-net-4-0-sys-is-not-defined-handler-mapping-issue

http://efreedom.com/Question/1-3822733/AjaxToolkit-IIS7-AspNet-40-Sys-Defined
http://geekswithblogs.net/lorint/archive/2007/03/28/110161.aspx
http://geekswithblogs.net/ranganh/archive/2007/07/15/113963.aspx
so looked over the net for the solution since it has been many days i could not remember the linke but following the solution.
in web.config section
System.webservrer
<rewrite> <rules> <rule name="wordpress" patternsyntax="ECMAScript">
<match url=".*"> <conditions> <add negate="true" input="{REQUEST_FILENAME}"
matchtype="IsFile"> <add negate="true" input="{REQUEST_FILENAME}" matchtype="IsDirectory">
<add negate="true" input="{URL}" pattern="\.axd$"> </conditions> <action
url="index.php" type="Rewrite"> </rule>


1 comment:

  1. ScriptResource.axd:494 Uncaught Error: Sys.ParameterCountException: Parameter count mismatch.
    at Function.Error$create [as create] (ScriptResource.axd:237)
    at Function.Error$parameterCount [as parameterCount] (ScriptResource.axd:413)
    at Function$_validateParameterCount [as _validateParameterCount] (ScriptResource.axd:118)
    at Function$_validateParams [as _validateParams] (ScriptResource.axd:70)
    at String$startsWith (ScriptResource.axd:491)
    at String.startsWith (762a2d1d8d472b3c2fd8-16b13df03354de441916afd4595f97a7.ssl.cf2.rackcdn.com/FRHI-SWISSOTEL.js:5)
    at new Sys$UI$DomEvent (ScriptResource.axd:3986)
    at browserHandler (ScriptResource.axd:4052)

    ReplyDelete