asmx web service, json, javascript/jquery?

I recommend you look my previous answer for the close questions How do I build a JSON object to send to an AJAX WebService? and Can I return JSON from an .asmx Web Service if the ContentType is not JSON? The correct code should looks like following [WebMethod] [ScriptMethod (ResponseFormat = ResponseFormat.Json)] public EntityLayer.TestPage1 GetData(int … Read more

Load data from Webservice (asmx) to jqgrid. Please help me

You example have a lot of problems. For example If you use [WebMethod, ScriptMethod(ResponseFormat = ResponseFormat.Json)] attribute on the web method and [ScriptService] on the the web service class, then the output parameter will be automatically converted to JSON. (see asmx web service, json, javascript/jquery? for example). Then you will not need implementthe functions like … Read more

asp.net asmx web service returning xml instead of json

Finally figured it out. The app code is correct as posted. The problem is with the configuration. The correct web.config is: <configuration> <system.web> <compilation debug=”true” targetFramework=”4.0″ /> </system.web> <system.webServer> <handlers> <add name=”ScriptHandlerFactory” verb=”*” path=”*.asmx” type=”System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ resourceType=”Unspecified” /> </handlers> </system.webServer> </configuration> According to the docs, registering the handler should be unnecessary from … Read more