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

HELP!! ScriptResource.axd Causes a JavaScript Error

1 Answer 299 Views
Spell
This is a migrated thread and some comments may be shown as answers.
Moises Jaramillo
Top achievements
Rank 1
Moises Jaramillo asked on 28 Jul 2008, 07:18 PM

When I spell-check a form that contains 2 or more controls as defined in the ControlsToCheckProperty, I get the following error message in the browser:

Microsoft JScript runtime error: Object required

I enabled the debugger within my markup and I was able to identify where the error ocurs within the ScriptResource.axd

if(this.get_element().value!=null){

try{

_21=this.get_element().value;

}

In this case, the this.get_element() is returning a null reference but the code still gets its value property.

Since the script is rendered by the HttpHandler, there is no way for me to add an additional check on the script.

The whole context is as this. An aspx page that already contained MS Ajax Extensions with a ScriptManager and an UpdatePanel. Changing this to the Telerik versions is not an option. It would require thousands of hours of regression testing from our QA team.

Need help!

1 Answer, 1 is accepted

Sort by
0
Obi-Wan Kenobi
Top achievements
Rank 1
answered on 30 Jul 2008, 12:29 PM
You can find a simple  online example with the ControlsToCheck property  here:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Spell/Examples/MultipleChecks/DefaultCS.aspx
I tried it and everything seems to be ok.
Also I made additional testing and I received the same error as yours when some of the controlIDs in ControlsToCheck is wrong, e.g.:
<%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head id="Head1" runat="server">  
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
    <div> 
      <asp:TextBox ID="TextBox1" runat="server" Text="aaaa sssssss ffffffffff"></asp:TextBox> 
        <asp:TextBox ID="TextBox2" runat="server" Text="aaaa sssssss ffffffffff"></asp:TextBox> 
        <telerik:RadSpell ID="RadSpell1" runat="server" ControlsToCheck="TextBox1,TextBox3" IsClientID="true" /> 
          
    </div> 
    </form> 
</body> 
</html> 
 
If you correct it everything is OK, e.g.
<%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head id="Head1" runat="server">  
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
    <div> 
      <asp:TextBox ID="TextBox1" runat="server" Text="aaaa sssssss ffffffffff"></asp:TextBox> 
        <asp:TextBox ID="TextBox2" runat="server" Text="aaaa sssssss ffffffffff"></asp:TextBox> 
        <telerik:RadSpell ID="RadSpell1" runat="server" ControlsToCheck="TextBox1,TextBox2" IsClientID="true" /> 
          
    </div> 
    </form> 
</body> 
</html> 
My opinion is that you have a wrong id in ControlsToCheck. Try one by one all IDs in ControlsToCheck and you will find the wrong one. 
Hope this helps!
Tags
Spell
Asked by
Moises Jaramillo
Top achievements
Rank 1
Answers by
Obi-Wan Kenobi
Top achievements
Rank 1
Share this question
or