script type="text/javascript"> function runTest() { var ffg = PageMethods.Test(); alert(ffg); } </script>
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"> </asp:ScriptManager>
[System.Web.Services.WebMethod] public string Test() { return "hello"; }
Test
static
[System.Web.Services.WebMethod] public static string Test() { return "hello"; }
function runTest() { PageMethods.Test(OnSucceeded, OnFailed); } function OnSucceeded(response) { alert(response); } function OnFailed(error) { alert(error); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)