Adam Schroder

Its Schotime.com!

July 2008 - Posts

Returning a Dataset, Datatable in Json

After my previous posts about returning data in JSON, I decided to have a go at returning a generic Datatable. This however is not as easy as simple returning a Datatable in your code behind method or web service. There a solution though and here it is.

If you break a Datatable down it is really only a List of Dictionary objects so that's how we'll approach this problem. This is compatible with .NET 2.0 and above, with the Ajax installed.

I'd like to acknowledge RichardD for the idea.

Click here to view the simple solution.

jQuery Plugin for ASP.net Ajax (jMsAjax)

After my recent post on jQuery, JSON and dates in asp.net I decided that there must be a better solution so I set out writing my first jQuery plugin. And after a few hours I had it working to my delight.

It not only accepts a raw JSON object as input for method parameters, but safely parses and stringify's the object using Crockford's implementation (http://www.json.org/js.html). The syntax of the call doesn't change if it is a "POST" or a "GET" as it is all handled inside the plugin. It also returns Dates without a problem.

Click here to keep reading....

Schotime

More Posts