Click here to Skip to main content
15,891,621 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can anyone point me to some example code that shows how to setup a cross domain webservice that will return JSON in a .asmx / ASP.NET 3.5 page? Cant seem to find a comprehensive examples.

I want to avoid MVC or WCF - especially now that the ASP.NET Web API is the latest and greatest but the smoke hasn't cleared w respect to native support (I think). Ive seen folks saying that a custom formatter can be added to the Web API formatter collection etc but that the code only works with the CodePlex version and builds are in flux and better to wait for RTM.

Ive set up successful web services in asmx pages and used jQuery to get JSON but now need to deliver an API so external partners on other domains can hit the service and get JSON formatted data back. My weak understanding is that callbacks are required along with it being neccessary to add an HttpModule to set the content-type ?

Cheers & thanx in advance !
Posted

1 solution

It would be easy with WCF:
http://www.west-wind.com/weblog/posts/2007/Oct/04/WCF-and-JSON-Services[^] even though you say you want to avoid WCF.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900