Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ajax client-side framework failed to load Asp.Net 4.0

I got a complicated problem with ASP.Net 4.0 Ajax....I started a website with Visual Studio 2010 on my machine,and added some update panels they used to work fine,but suddenly i got that series of errors when i run my website

Microsoft JScript runtime error: ASP.NET Ajax client-side framework failed to load.

Microsoft JScript runtime error: 'Sys' is undefined

The strange things is that i made a website on the same machine with VS 2010 and the update panels there work perfectly.i took its web.config to my new website and changed just the connection..and i got the same error

I tried to search for a solution but i failed to find any real solution.Can anyone help?

like image 665
Khaled Avatar asked Sep 12 '10 15:09

Khaled


1 Answers

Here is the answer by zhughes from this thread on asp.net forum.

The Reason : the path of the javascript generated by the scriptmanager changes when the URL Routing module is used.

The Solution : Tell the routing API to not route the files with "axd" extension (the files generated by the scriptmanager)

Add this rule to the method where you register the routing rules in Global.asax

 routes.Ignore("{resource}.axd/{*pathInfo}"); 

in addition you should have this section in web.config

<system.webServer>     <modules runAllManagedModulesForAllRequests="true" /> </system.webServer> 
like image 151
Khaled Avatar answered Sep 28 '22 14:09

Khaled