Ajax toJSON not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • balajibirlasoft
    New Member
    • Feb 2008
    • 4

    Ajax toJSON not working

    Am using a default converter object in ajax to convert the tables collection to a JSON string.

    First Input for toJSON Method is strTempData(Str ing Builder)

    Second Input is the object for which i passed a DataSet.Tables collection.

    Ajax.JSON.Defau ltConverter.ToJ SON(ref strTempData, objResultDTO.Re sultdtset.Table s);

    I will connect to this page using XMLHTTP and return the generated JSON string back to the Client and process the JSON String for every x seconds using SetTimeout method.

    At Some times it is working correctly and generates and Returns the JSON string correctly.

    But after some time it is returning the Object name directly like "System.Data.Da taTableCollecti on".

    Why it is not processing the object correctly to generate the JSON ?
    What might be the problem...?
    Ajax Version = 5.6.3.4
  • balajibirlasoft
    New Member
    • Feb 2008
    • 4

    #2
    Ajax JSON Converter problem

    Any one knows how to use Ajax.JSON.Defau ltConverter.ToJ SON method
    or is it a correct method to generate the JSON String

    Ajax Version = 5.6.3.4

    Because am not able to generate the JSON string correclty all the times..
    Some times it is correctly converting it into JSON String and at some time it is directly giving the string like System.Data.Dat aSet or DataTableCollec tion or DataRow directly as output

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Merged threads on the same problem.

      What library are you using?

      Comment

      • balajibirlasoft
        New Member
        • Feb 2008
        • 4

        #4
        Ajax.NET Library version 5.6.3.4
        Ajax.dll

        I added a reference to the ajax.dll and used those methods..

        Using this method

        Ajax.JSON.Defau ltConverter.ToJ SON(sb,obj)

        How can i overcome this problem..?

        Please give me a suggestion...

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Well, in that case, you'll have better luck in the .NET forum to which I've moved this thread.

          Comment

          Working...