Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET jQuery JSONP
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 11-Jul-12 8:06am
BJC23411

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 195
1 Afzaal Ahmad Zeeshan 132
2 ProgramFOX 130
3 Maciej Los 105
4 Sergey Alexandrovich Kryukov 75
0 OriginalGriff 6,564
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,228
3 Manas Bhardwaj 4,657
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 22 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100