Getting Json data using jQuery and .ASMX web services.
If you still have the misfortune to work with asmx services on your project, you may want to know how to easily retrieve json data from an asmx method. The differences between asmx and WCF have been aalyze[d b]efore here and here. Return a simple string as json response:### Your asmx page code#### [WebService(Namespace = "http://contoso.com/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]System.Web.Services.WebService [ScriptService] public class services :WebService { [WebMethod(CacheDuration = 60)] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string GetGreeting() { return "hello world" } } Your javascript code#### …. code omitted … var getGreeting = function() { var …[read more]