What is the correct way to convert ASP.NET SOAP-based web services to JSON-based responses? ...And then call these from jQuery?
What are \"best practices\" when integrat
I've used ASP.Net Ajax for a while, but without ever worrying about JSON or XML communication. Instead, I've used Web services to directly return content that you can set using innerHTML.
This is very easy to implement. Just create a web service (ASMX) file, and declare your methods as WebMethods (set the WebMethod attribute).
Now you can call your web service from your Javascript code pretty much like a regular function.
The results of the function will be returned to a call-back function. This is the structure
//Webmethod returns some HTML content
Myservice.DoSomething(myParam, callBackFunction);
//Content is set on the webpage
function callBackFunction(result){
document.getElementById('myElemID').innerHTML = result;
}