I want to call a web method using jquery ajax get method.but it is not getting called. below my javascript and code
javascript:
function RetrievePassword() {
var forgotEmail = $("#txtForgotEmail").val().trim();
//call the ajax method to retrieve the password from the email address provided.
$.ajax({
type: "GET",
url: "test.aspx/RetrievePassword?email=" + forgotEmail,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {
alert(result.d);
},
error: function () {
alert("Error while calling the server!");
}
});
}
my code behind function
[WebMethod]
[ScriptMethod(UseHttpGet=true)]
public static string RetrievePassword(string email)
{
//some code
}
Can anybody help me on this..