$.ajax({ type: "POST", url: "ajaxPage.aspx/testMethod", data: "{test:'test'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (result) { $("#span_result").html(result.d).fadeIn(); }, error: function (msg) { $("#span_result").hide(); } });
//ajaxPage.aspx.cs [System.Web.Services.WebMethod] public static string testMethod(string test) { return test; }
<asp:scriptmanager id="ScriptManager1" runat="server" enablepagemethods="true" xmlns:asp="#unknown" />
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)