Re: Where Is Client-Side Support for Deserializing/Consuming JSON?

Discussion in 'ASP .Net' started by George, Jan 26, 2009.

  1. George

    George Guest

    JSON is a native JavaScript object definition.
    So desirialization is pretty much built in.

    try this
    data = eval("(" + jsonstring + ")");



    George.


    "Jordan S" <> wrote in message
    news:...
    >I have been googling this for several hours now and I'm surprised to find
    >so little support for a task I would think practically every
    >AJAX-to/from-WebService-via-JSON style app would need: deserialization of
    >the JSON-serialized value received in the client from the Web service.
    >
    > There is apparently a whole lot of server-side support for serializing TO
    > JSON, and server-side support for deserializing from JSON received from
    > the client (e.g, System.Web.Script.Serialization.JavaScriptSerializer) ...
    > but I'm not finding much client-side support for parsing and retrieving
    > JSON received from the server.
    >
    > Say, for example, that I have a Web service that instantiates a Person
    > object (with a couple of simple text properties like FirstName and
    > LastName), then returns a JSON-serialized version of that Person object.
    >
    > Ideally, I would like to have a Person object to work with *on the
    > client*. Of course it would be a "JSONized" version of "Person" with only
    > text values - but still I wouldn't have to parse the JSON string. It would
    > be someting like this:
    > var person = serverResponseValue;
    > var lastName = person.LastName;
    > ...
    >
    > So what my [mostly] futile googling has resulted in is only one library
    > that provides what I want: It's "Jayrock" (http://jayrock.berlios.de/), an
    > open source implementation of JSON-RPC for .NET.
    >
    > Am I missing something? Is there some other well-known library that
    > provides what I want? My intent is to be using jQuery for my client-side
    > processing, and I'm not finding anything in the way of built-in support or
    > plugins that let me consume a JSONized object returned from the
    > server-side method as described above.
    >
    > Your thoughts are appreciated.
    >
     
    George, Jan 26, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ryan Jacops
    Replies:
    0
    Views:
    129
    Ryan Jacops
    Sep 17, 2003
  2. Florian Frank
    Replies:
    0
    Views:
    259
    Florian Frank
    Jun 30, 2009
  3. sajuptpm
    Replies:
    2
    Views:
    373
    sajuptpm
    Dec 28, 2012
  4. Acácio Centeno
    Replies:
    1
    Views:
    302
    dieter
    Feb 15, 2013
  5. Bryan Britten
    Replies:
    9
    Views:
    286
    Bryan Britten
    May 28, 2013
Loading...

Share This Page