Hi everyone i trying to get data from cs to js using ToolkitScriptManager. this is my aspx :
You need to supply a success and a failure callback to the webmethod call as below.
$(window).load(function () {
PageMethods.isConnected(fnsuccesscallback,fnerrorcallback);
});
function fnsuccesscallback(data) {
alert(data);
}
function fnerrorcallback(result) {
alert(result.statusText);
}
Also, there is another way of accessing the page methods using $.ajax.