Several months ago, one of my customers asked me a fairly pointed question:
At least, that's what they asked me, but not really what they meant (I'll explain what their real question was in a subsequent post).
In the old days, you probably wrote a web service that looks like this.
Some of you are probably thinking, "whaddya mean, the way things used to be? I just coded that exact code this week?!?"
Enabling ASMX With JSON
Download the Microsoft AJAX Library 3.5 from the ASP.NET AJAX Downloads Web site.
Unzip the MicrosoftAJAXLibrary.zip package.
Using the ScriptManager Control
One of the things that ASP.NET makes simpler for you is the ability to skip the step above where you copy the proxy code (recall that I copied into a file called proxy.js)... ASP.NET AJAX will handle the proxy stuff for you if you use a very useful control called ScriptManager. Further, you don't need to pull in the script reference for MicrosoftAjax.js, because the ScriptManager will do that for you, as well. Using ASP.NET, the code simply becomes:
Next up... replacing our ASMX with WCF.
more : blogs.msdn.com