RadSpell Javascript Error

9 posts, 0 answers
  1. Will
    Will avatar
    7 posts
    Member since:
    Jun 2008

    Posted 03 Sep 2009 Link to this post

    I am receiving the following javascript error when clicking on the RadSpell button and the control is placed on a page that is configured with forms authentication in the web.config:

     

     

    Message: Sys.ArgumentException: Cannot deserialize. The data does not correspond to valid JSON.

    Parameter name: data

    Line: 4723

    Char: 21

    Code: 0

    URI: http://localhost/ScriptResource.axd?d=ryM-v-atWyafyRba-J4cHMmodSS-DVBnOhmaxNYGoPR8dRTdvokZrasX9uQLzL3Wl7dgKSsFPn6IJHWdrzJk_1bOgV6KrLCExaizZfaNpIQ1&t=ffffffffe5f2f277

     

    When the location element is removed from the web.config, the spell check works.

     

    Below are the relevant web.config settings:

     

      <location path="MyPage.aspx">

        <system.web>

          <authorization>       

            <allow roles="MyRole" />

            <deny users="*" />

          </authorization>

        </system.web>

      </location>

     

    <system.web>

        <httpHandlers>

          <remove path="*.asmx" verb="*" />

          <add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />

          <add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />

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

          <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" />

          <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" />

        </httpHandlers>

    </system.web>

     

    This is the page markup:

     

    <asp:TextBox ID="txtMyTextBox" runat="server" TextMode="MultiLine" />

    <telerik:RadSpell ID="rsRadSpell" runat="server" ControlToCheck="txtMyTextBox" SupportedLanguages="en-US,English" />

     

    I found a similar thread from last year, and the recommended solution was to reboot and add the handlers with the smart tag.  This did not work for me, and the problem has occurred on multiple computers.  I would appreciate any help with this problem.

     

    Thanks,

     

    Will

  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 04 Sep 2009 Link to this post

    Hi Will,

    You need to add location for the spellcheck handler and telerik's resources in your web.config file so they are available for all users.
    e.g.
    <location path="Telerik.Web.UI.WebResource.axd"
       <system.web> 
         <authorization> 
           <allow users="*"/> 
         </authorization> 
       </system.web> 
     </location> 
    <location path="Telerik.Web.UI.SpellCheckHandler.axd"
       <system.web> 
         <authorization> 
           <allow users="*"/> 
         </authorization> 
       </system.web> 
    </location> 
        


    Greetings,
    Georgi Tunev
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Will
    Will avatar
    7 posts
    Member since:
    Jun 2008

    Posted 04 Sep 2009 Link to this post

    Georgi,

     

     

    Thanks for your response.  However, that did not fix the problem.  I also added the following without any luck:

     

     

      <location path="Telerik.Web.UI.DialogHandler.aspx">

        <system.web>

          <authorization>

            <allow users="*"/>

          </authorization>

        </system.web>

      </location>

     

    Are there any other recourses that all users need access to?

  5. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 08 Sep 2009 Link to this post

    Hi Will,

    The only way to reliably trace this problem is to use a HTTP debugging proxy (Fiddler for IE, Firebug's Net panel for Firefox) and see what is the server response for the Telerik.Web.UI.SpellCheckHandler.axd request. If it contains exception information, then the problem is with the server-side spell check - for example the custom dictionary might contain invalid words. In this case, removing the custom dictionary will fix the problem. If the spell check handler response contains a different page (e.g. a login page), then you need to make sure it is not redirected - double check your web.config file and the handler's <location> element, exclude it from any third party http modules (e.g. URL rewriting), make sure that it is registered in the correct place (<system.webServer> for IIS 7 integrated mode or <system.web> otherwise).

    All the best,
    Lini
    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.
  6. Will
    Will avatar
    7 posts
    Member since:
    Jun 2008

    Posted 08 Sep 2009 Link to this post

    Lini,

     

    Thank you very much for your debugging suggestion.  A look at the requests in fiddler showed my problem.  I had given authorization to SpellCheckHandler.axd from the root of the application, but the true request to the Axd included the path to the page that was requested.  So the solution was to replace this:

     

    <location path="Telerik.Web.UI.SpellCheckHandler.axd">

     

    with this:

     

    <location path="MyFolder/Telerik.Web.UI.SpellCheckHandler.axd">

     

    Thanks again,

     

    Will

  7. Assaf
    Assaf avatar
    3 posts
    Member since:
    Jul 2010

    Posted 02 Sep 2010 Link to this post

    I just came across the same issue.

    I found out that this error always raised when using the URL rewriting feature (dot.Net 4.0) .
    When the page where the editor control is located being accessed using the mapped route, the SpellCheck always fail. When the page is accessed using its actual URL the SpellCheck runs successfully.

    Assaf.
  8. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 02 Sep 2010 Link to this post

    Hi Assaf,

    Can you please replace the ashx extension of the Telerik.Web.UI.SpellCheckHandler handler in the web.config file

    <add path="Telerik.Web.UI.SpellCheckHandler.ashx" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false"/>

    with axd, e.g.
     
    <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" />

    and set the AjaxUrl property inline in the RadSpell declaration:

    <telerik:RadSpell id="RadSpell1" AjaxUrl="~/Telerik.Web.UI.SpellCheckHandler.axd" runat="server" ControlsToCheck="TextBox1" />

    All the best,
    Rumen
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  9. Assaf
    Assaf avatar
    3 posts
    Member since:
    Jul 2010

    Posted 03 Sep 2010 Link to this post

    Rumen,

    Thank you for your prompt response.

    Adding a telerik:RadSpell does work with URL Rewriting but adds a new button to form.

    Is there a way to make this work with the integrated spell check button?
    I tried setting the AjaxUrl of the editor's SpellCheckSettings property but that did not work (same error message):

    <telerik:RadEditor ID="txtDoc" runat="server" Height="700px" Width="100%" Skin="Windows7">
      <SpellCheckSettings AjaxUrl="Telerik.Web.UI.SpellCheckHandler.axd" />
      ...

    Regards,

    Assaf


  10. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 06 Sep 2010 Link to this post

    Hello Assaf,

    The solution should work with the inline spellchecker of RadEditor.

    Nevertheless, you can fire the standalone and hidden spellchecker from a custom RadEditor button using the solution provided in this KB article: Using RadSpell "Prometheus" dialog with RadEditor "Prometheus" as a custom tool.

    Greetings,
    Rumen
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017