I'm trying to support a legacy app I made a year ago and need to use jQuery AJAX calls to get data from the server. I have a JsonHelper class that I use to serialize DataTable
s and DataSet
s. This normally works fine in .NET 4.0, but .NET 2.0 there is no System.Web.Script.Serialization
library and therefore no JavaScriptSerializer
class.
I've tried to find another JSON serializer, but so far I can't get anything to work.
I tried using JSON.NET 2.0 http://json.codeplex.com/releases/view/13099 but it said it needed a higher framework. So I tried JSON.NET 1.3.1 http://json.codeplex.com/releases/view/6987 I could only figure out how to write JSON to a .txt file, and I'd like to just be able to pass the string back to the client.
I also just tried JsonFx.NET http://jsonfx.net/download/ serialization library (for 2.0). Still couldn't get anything to work.
I don't know if I'm missing some crucial element of these libraries or if there is an easy solution.
Thanks in advance