This is a migrated thread and some comments may be shown as answers.

System.Web.Routing and ASP.NET Ajax client-side framework failed to load

3 Answers 186 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Brete
Top achievements
Rank 1
Brete asked on 25 Jan 2011, 06:04 PM
Under ASP.NET 4.0,  when using System.Web.Routing  (URL Routing)  with telerik controls on the rendered page.  I am encountering ASP.NET Ajax client-side framework failed to load.

<

 

 

script src="/ThriventPromoRad40/WebResource.axd?d=kuV-9BW9vUE9mrfKFZ3iarEeZ53VRoFdPvU6l_eVkRJWggZVCdkkPTfmCxIghLXyMbupWxfy9hdfoXjjTxbduMDzGQNVIEKoR1dpIpiTxB81&amp;t=634226478236080422" type="text/javascript"></script>

 

<

 

 

script src="/ThriventPromoRad40/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&amp;compress=1&amp;_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a1f68db6e-ab92-4c56-8744-13e09bf43565%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%3aen-US%3aaa801ad7-53c4-4f5c-9fd3-11d99e4b92f4%3a16e4e7cd%3aed16cbdc%3a7165f74" type="text/javascript"></script>

 

<

 

 

script type="text/javascript">

 

//<![CDATA[

if

 

 

(typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax client-side framework failed to load.');

 


 
If I remove the routing options or if I replace the Telerik controls with generic ASP.NET controls.  (IE: Radbutton with ImageButton).  The page functions correctly. 

Any suggestions?

Brete


3 Answers, 1 is accepted

Sort by
0
Brete
Top achievements
Rank 1
answered on 25 Jan 2011, 08:27 PM

I figured it out. 

Add the following to the Global.asax

 

 

void

 

 

Application_Start(object sender, EventArgs e)

 

{

RegisterRoutes(

 

RouteTable.Routes);

 

}

 

 

void RegisterRoutes(RouteCollection routes)

 

{

routes.Add(

 

new Route("{resource}.axd/{*pathInfo}", new StopRoutingHandler()));
// Be sure this route is first. 
routes.MapPageRoute(
"","{data}","~/WELCOME.aspx");
//additional routes. 

}

 

0
Renier
Top achievements
Rank 1
answered on 19 Apr 2011, 03:12 AM
So it works:

 

           static void RegisterRoutes(RouteCollection routes)
        {
            routes.Ignore("{resource}.axd/{*pathInfo}");
            routes.MapPageRoute("Pages", "{DatoEntrada}",
                                "~/Default.aspx");
     }
       protected void Application_Start(object sender, EventArgs e)
        {
            RegisterRoutes(RouteTable.Routes);
        }
0
Erik
Top achievements
Rank 2
answered on 14 Sep 2011, 11:29 AM
hello all,

please keep in mind: I had a lot of problems with this; I randomly got blanc pages due to javascript ajax errors ("sys is undefined, telerik is undefined, ajax framework didn't load...)

This only happens with the RadScriptManager, not with the MS one.

lateron i found this post (and similar around the net):

http://www.pcreview.co.uk/forums/url-routing-asp-net-3-5-breaks-ajax-t4013255.html

Tags
Ajax
Asked by
Brete
Top achievements
Rank 1
Answers by
Brete
Top achievements
Rank 1
Renier
Top achievements
Rank 1
Erik
Top achievements
Rank 2
Share this question
or