I have used onSuccess and onFailure in my PageMethod call. However neither of them gets called and the WebMethod doesn't get fired either.
alert("1");
PageMethods.LoginUser(onSuccess, onFailure, email, pass);
alert("2");
function onSuccess(val)
{
}
function onFailure()
{
}
[WebMethod(EnableSession = true)]
public static int LoginUser(string email, string pass)
{
//Doesn't get fired
}
When I remove them and send only the values to the WebMethod, it works:
PageMethods.LoginUser(email, pass);
//This fires the Web Method
I have enabled PageMethods in my ScriptManager as well. What am I doing wrong?
You PageMethod is looking like this
PageMethods.LoginUser(onSuccess, onFailure, email, pass);
And when you call it, it looks like this
Your arguments should be in the same order as the method.