Error when sending JSON string via ajaxRequest() method

4 posts, 0 answers
  1. Rob
    Rob avatar
    8 posts
    Member since:
    Aug 2010

    Posted 20 Dec 2012 Link to this post

    I have the following JavaScript code that creates a really simple JSON object...

    var data = {'MyID':1,'MyItem':'This is the first item'};
    var JSONdata = JSON.stringify(data);
    $find('<%= RadAjaxManager1.ClientID %>').ajaxRequest(JSONdata);

    This generates the following JSON string after running the object through the stringify method...

    {"MyID":1,"MyItem":"This is the first item"}

    This is valid JSON according to JSONLint.com.

    Calling the .ajaxRequest() method results in Sys.WebForms.PageRequestManagerServerErrorException - "Specified cast is not valid"

    It's not even getting to my RadAjaxManager1_AjaxRequest() event handler where I have a breakpoint set to inspect the value of e.argument.

    What's wrong here?

    I'm using version 2010.3.1317.35 of the Telerik controls.

    Rob  
  2. Rob
    Rob avatar
    8 posts
    Member since:
    Aug 2010

    Posted 20 Dec 2012 Link to this post

    Using Web Development Helper the callstack for this error is as follows:

    at http://localhost:3391/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ContentPlaceHolder1_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a553a4a13-b3a5-4e6b-a152-b131051f1788%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2010.3.1317.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3ad7b88a55-4248-43ee-a9ed-d9058fd97467%3a16e4e7cd%3a7165f74%3aed16cbdc [6]
        JScript anonymous function
  3. Rob
    Rob avatar
    8 posts
    Member since:
    Aug 2010

    Posted 20 Dec 2012 Link to this post

    Further debug information - the error is occurring in code emitted into one of the Telerik.Web.UI.WebResource.axd's...

    Error.create Telerik.Web.UI.WebResource.axd:6

    Sys.WebForms.PageRequestManager._createPageRequestManagerServerError Telerik.Web.UI.WebResource.axd:15
    Sys.WebForms.PageRequestManager._parseDelta Telerik.Web.UI.WebResource.axd:15
    Sys.WebForms.PageRequestManager._onFormSubmitCompleted Telerik.Web.UI.WebResource.axd:15
    (anonymous function) Telerik.Web.UI.WebResource.axd:6
    (anonymous function) Telerik.Web.UI.WebResource.axd:6
    Sys.Net.WebRequest.completed Telerik.Web.UI.WebResource.axd:6
    _onReadyStateChange

    The array of JSON objects that I was sending as the RadAjaxManager's ajaxRequest() argument was originally 34 elements in length. To eliminate the problem being down to the length of the array I restricted it to two items, however the problem still occurs.

    Please take a look at this for me - I'm running out of ways to isolate the problem.

    Many thanks,
    Rob
  4. Pavlina
    Admin
    Pavlina avatar
    6187 posts

    Posted 25 Dec 2012 Link to this post

    Hi Rob,

    Can you download latest version of RadControls for ASP.NET AJAX and verify that the same error still persists?

    Kind regards,
    Pavlina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top