I'm a newbie in jQuery and don't understand how in jQuery Ajax returns data. I have some simple function to get some data like below
[WebMethod(EnableSession = false)]
protected int SignIn()
{
return 0;
}
and in my .aspx page I have this
$(document).ready(function () {
$("#si").click(function
() {
$.ajax({
type: "POST",
url: "SignIn.aspx/SignIn",
contentType: "application/json",
success: function (txt) {
alert(txt);
}
});
});
});
but in alert I get the whole SignIn.aspx (all html tags and so on). how to alert the 0 which the SignIn() returns?thanks