пожалуйста, дайте мне знать, что я здесь делаю не так?
$.ajax({
type: "POST",
url: "index.aspx/check_phone_no_server",
data: "{'Email':'" + $('#phoneno').val() + "'}",
async: false,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
alert(response.d);
if (response.d != "0")
alert("1 is heere");
else {
alert("0 is heere");
}
}
});
[System.Web.Services.WebMethod]
public static string check_phone_no_server(string Email)
{
//index a = new index();
//return a.check_phone_no();
return Email.ToString();
}

Вы должны просто передать данные как Object, а не как String:
$.ajax({
type: "POST",
url: "index.aspx/check_phone_no_server",
data: {
Email: $('#phoneno').val() //will probably not be phoneno
},
async: false,
dataType: "json",
success: function (response) {
alert(response.d);
if (response.d != "0")
alert("1 is heere");
else {
alert("0 is heere");
}
}
});
Что ж, теперь ваши данные находятся в формате application/x-www-form-urlencoded, но ваш тип контента говорит, что application/json; charset=utf-8
Виноват. Я обычно даже contentType не ставлю при использовании ajax XD
Какой у вас точный вопрос?