Sys.ScriptLoadFailedException. The script /Script.Resource.Axd could not be loaded

6 posts, 0 answers
  1. Jonathan Pfeffer
    Jonathan Pfeffer avatar
    3 posts
    Member since:
    Jan 2010

    Posted 25 Jan 2010 Link to this post

    I am using ASP.NET 2.0 in VS2008 using telerik AJAX Q3 2008.

    I am using a page with several Telerik controls including RadWindow RadGrid etc. RadTextBox rad ToolTip

    when I call txtBox.Focus from the server side where txtBox is a RadTextBox I get the error

    Sys.ScriptLoadFailedException. The script /Script.Resource.Axd could not be loaded.

    What is up?

    If I don't call the Focus() method of the RadTextBox I do not get the javascript error.





  2. Jonathan Pfeffer
    Jonathan Pfeffer avatar
    3 posts
    Member since:
    Jan 2010

    Posted 25 Jan 2010 Link to this post

    Further to that.

    I created a new radTextBox on the form, focus does work on the new one.

    However, the first control that failed is on a div who is defined as:

     

    <div runat="server" id="pnlMovement" style=" background: #E0E0FF;

     

    position: absolute; width: 99%; height: 30px; left: 1px; top: 500px; z-index: 10;

     

     

     

     

     

     

    border-color: Navy; border-style: solid; border-width: thin;">

     

     

     

     

     

     

     

    What I do is I hide and reposition this div as needed.

    The error happens to any RadTextBox on this div and not to any RadTextBox not on the div, therefore it appears that the div is the issue.

    After even further study. The issue seems to be the postback. After a postback it happens.

    Also please note that I am using a RadAjaxPanel for the entire form.

  3. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 28 Jan 2010 Link to this post

    Hello Jonathan,

     Could you paste your aspx and code-behind. How are you repositioning the div, are you taking it outside the RadAjaxPanel?

    Thanks in advance.

    Regards,
    Tsvetoslav
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  4. Jonathan Pfeffer
    Jonathan Pfeffer avatar
    3 posts
    Member since:
    Jan 2010

    Posted 29 Jan 2010 Link to this post

    It turns out after searching the web for this error that I was missing this in my web config

    <

     

    httpHandlers>

     

    ...

    <

     

    add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>

    Since my project predates AJAXs and was not build from an ajax template it was missing

    Thanks.

     

  5. David
    David avatar
    3 posts
    Member since:
    Oct 2007

    Posted 28 May Link to this post

    I've found two different situations that caused this error.

    Visible=false
    In the first scenario, I've found that it had to do with a Telerik controls Visibility being set to false and changing it to true in the code behind.  The client-side javascript throws an error.  Instead of using the Visible, I had to add an style attribute for display=none instead and then remove that style when the control is to be seen again.  This implementation works around the client side issue.

                        pnlEdit.Style.Remove("display");
                        pnlLabel.Style.Add("display", "none");

    and

                        pnlEdit.Style.Add("display", "none");
                        pnlLabel.Style.Remove("display")

     

    Set Focus
    A second scenario was when I was setting focus to a RadNumericTextBox (the type of rad control may not matter).  I couldn't simply set focus to the control, I had to tell the panel in which the numeric text box was in to set control to the text box.

                        txtToFocus = item.FindControl("txtQuantityOnHand") as RadNumericTextBox;

                        pnlContent.FocusControl(txtToFocus);
                        //txToFocus.Focus(); //this way causes client side issues.

     

  6. Rumen
    Admin
    Rumen avatar
    13980 posts

    Posted 29 May Link to this post

    Hi David,

    Thank you very much for sharing your findings and way to solve the error! This is much appreciated and your Telerik points were updated.

    Best Regards,
    Rumen
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top