views:

869

answers:

5

I would like create a web service in ASP.Net 2.0 that will supports JSON. Is there a way to do this without WCF and .Net 3.5? Can anyone point me to a good article or sample code?

Clarification

I need direction on what is the best method, using the .Net 2.0 framework, to communicate JSON objects to a client. Is it possible to do this without serializing the object to a string and then deserializing on the client?

A: 

You can utilize WCF for your website, The WCF JSON endpoint can even generate javascript client proxy for the service.

Check out this post

http://stackoverflow.com/questions/186631/rest-soap-endpoints-for-a-wcf-service#186695

A download sample can be found

http://www.codemeit.com/wcf/wcf-restful-pox-json-and-soap-coexist.html

codemeit
Thanks - I would to do this without WCF.
David Robbins
+1  A: 

WCF is great, but requires .net 3.5.

Check out this article on MSDN that describes quite a bit about JSON and asp.net from an introductory level.

http://msdn.microsoft.com/en-us/library/bb299886.aspx

Joe Basirico
A: 

I found this API for LINQ to JSON very helpful and easy.

kenny
Thanks - I use JSON.Net currently. What I am looking for is the ability for a web written in .Net 2.0 to return JSON objects. In other words, I don't want to serialize objects and transmit the serialized string.
David Robbins
Isn't JSON serialized by its nature? Javascript Serialized Object Notation(?)
kenny
+2  A: 

use JayRock!

JayRock will work with .net 2.0

http://jayrock.berlios.de/

NTulip
+1  A: 

You can't do it with standard 2.0 without serialization.

Kon