I have general question that if an asp.net webmethod always returns data in ‘json’ form.If not what is the default return datatype of a webmethod?
I am wondering if there is a way I can get the data from a webmethod in ‘HTML’ rather than ‘json’?
Thanks
PageMethods are a part of the ASP.NET AJAX Framework (ScriptManager).
By default, ASP.NET AJAX uses JSON as opposed to SOAP.
This is by design, mainly because the ASP.NET AJAX Javascript library it optimized to work with JSON objects.
You can override this default by specifying the [ResponseFormat] attribute on the web method.
Like this:
Here is a decent article on PageMethods and ASP.NET AJAX-enabled web services.