1. PageMethods needs to be static
[WebMethod] public static int MethodName() { }
2. Enable pageMethods in scriptManager
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"> </asp:ScriptManager>
3. add reference to script service in code behind
Add [Microsoft.Web.Script.Services.ScriptMethod] or [System.Web.Script.Services.ScriptService] in code behind below [WebMethod]
WebMethod]
[Microsoft.Web.Script.Services.ScriptMethod]
public static string GetRecords()
{
//DO something
}Hope this helps
![]() |
||
|
|
![]() |
|
| add to del.icio.us saved by 0 users |










1 comments:
Add script manager attribute as EnablePartialRendering="true".
Post a Comment