Hi All,
I have an pagemethod to retrieve the custname from database. But while using that pagemethod call inside my javascript file it shows error like
"
PageMethod not Defined"
I think PageMethods are unknown to my Javascript file...
Please give me your suggestions to solve this issue....
My Javascript contains...
function CallMe(src,dest)
{
var ctrl = document.getElementById(src);
PageMethods.GetContactName(ctrl.value, CallSuccess, CallFailed, dest);
}
function CallSuccess(res, destCtrl)
{
var dest = document.getElementById(destCtrl);
dest.value = res;
}
function CallFailed(res, destCtrl)
{
alert(res.get_message());
}
My
MasterPage Content contains...
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" EnablePartialRendering="true">
My code behind...
[System.Web.Services.WebMethod]
public static string GetContactname(string custid)
{
}
Initialize onload...
txt_custid.Attributes.Add("onblur", "javascript: CallMe('" + txt_custid.ClientID + "', '" + txt_custname.ClientID + "')");