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

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

5 Answers 116 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Jonathan Pfeffer
Top achievements
Rank 1
Jonathan Pfeffer asked on 25 Jan 2010, 07:33 PM
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.





5 Answers, 1 is accepted

Sort by
0
Jonathan Pfeffer
Top achievements
Rank 1
answered on 25 Jan 2010, 07:46 PM
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.

0
Tsvetoslav
Telerik team
answered on 29 Jan 2010, 05:36 AM
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.
0
Jonathan Pfeffer
Top achievements
Rank 1
answered on 29 Jan 2010, 02:29 PM
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.

 

0
David
Top achievements
Rank 1
answered on 28 May 2019, 02:23 PM

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.

 

0
Rumen
Telerik team
answered on 29 May 2019, 02:00 PM
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.
Tags
Ajax
Asked by
Jonathan Pfeffer
Top achievements
Rank 1
Answers by
Jonathan Pfeffer
Top achievements
Rank 1
Tsvetoslav
Telerik team
David
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or