Jquery's Ajax Property For Asp.Net 2.0
问题 I always see the code like this in the blogs: $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebService.asmx/HelloWorld", data: "{}", dataType: "json", success: function(msg) { alert(msg.d); } }); But I think this is run only with asp.net 3.5. I couldn't run it with 2.0. How can I use such these codes in my Applications? 回答1: You need to add this attribute to your webserver class [System.Web.Script.Services.ScriptService] public class Service : System.Web