Hi,
gud evening Khan br,
i found Your Article from link :
http://www.aspsnippets.com/Articles/Calling-server-side-function-from-JavaScript-in-ASP.Net.aspx
that explains how to call server-side Method from javascript,
i used your code, my server-side function is static, public, and also i addeed
[System.Web.Services.WebMethod] and
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
</asp:ScriptManager>
bt at run time the Error is PageMethods is undefined
i write:
PageMethods.Alpha();
Alpha is my server-side Method of void type and have no arguments,
i have applied this code in user Control
[System.Web.Services.WebMethod]
public static void Alpha()
{
try
{
Page pg1=new Page();
Label Msg = (Label)pg1.FindControl("lblMsg");
Msg.Text = "Function Called";
}
catch (Exception ex)
{
//lblMsg.Text = ex.Message.ToString();
}
}