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

4 posts, 0 answers
  1. Brete
    Brete avatar
    33 posts
    Member since:
    Feb 2008

    Posted 25 Jan 2011 Link to this post

    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


  2. Brete
    Brete avatar
    33 posts
    Member since:
    Feb 2008

    Posted 25 Jan 2011 Link to this post

    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. 

    }

     

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Renier
    Renier avatar
    7 posts
    Member since:
    Mar 2007

    Posted 18 Apr 2011 Link to this post

    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);
            }
  5. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 14 Sep 2011 Link to this post

    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

Back to Top