script Error : PageMethods is undefined

Posted by Abhi_patil under JavaScript on 6/9/2009 | Views : 22976 | Status : [Member] | Replies : 1
how to call web method...i am getting error 'PageMethods' is undefined
my script is..

<ajaxToolkit:ToolkitScriptManager runat="server" AsyncPostBackTimeout="240" ID="ScriptManager1" EnablePageMethods="true" />

<script type="text/javascript" language="javascript">
window.setInterval(AutoSave,1000);
function AutoSave()
{
alert('called');
var msg=document.getElementById('ctl00_ContentPlaceHolder1_txtMessage').value;
var num=document.getElementById('ctl00_ContentPlaceHolder1_txtNumber').value;
PageMethods.SaveData(msg,num,OnSucceeded);

}
function OnSucceeded(result, userContext, methodName)
{

}
</script>

my server side code is..
[WebMethod]
public static string SaveData(string msg, string num)
{
//Users_AutoSave save = new Users_AutoSave();
string str = "";
//save.updateDB(msg, num);
return str;
}




Responses

Posted by: Raja on: 6/9/2009 [Member] Starter

Up
0
Down
Please look at following links, this will be helpful.

http://www.velocityreviews.com/forums/t666494-pagemethods-is-undefined.html

http://forums.asp.net/p/993893/1296227.aspx

Thanks

Regards,
Raja, USA

Abhi_patil, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response