Code-behind:
[ScriptMethod]
[WebMethod]
public string SavePassword(string password, string username, string resellerId, string isPasswordReset)
{
return null; // For example
}
javaScript:
$.ajax({
type: 'POST',
url: 'login.aspx/SavePassword',
data: '{"password":"' + passwordInput + '","username":"' + hidusrname + '","resellerId":"' + hidResellerId + '","IsPasswordReset":"' + hidIsPasswordReset + '"}',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (result) { },
error: function () { alert('error');
}
});
public static string SavePassword()
works, public string SavePassword()
does not work.
If i change webmethod as static it works if i don't it does not work.
How can i webmethod without static
method in my page ?