I have a function like this
[WebMethod]
public static string Hello()
{
return "hello";
}
I want to call it in my aspx page. so this is what I am trying
function sendData(){
$.post("Default.aspx/Hello", function(data){
alert(data);
}).fail(function() {
alert( "error" );
});
}
Now caling this is successful and doesn't return error, but it doesn't return what I want. Instead of returning the string "hello" it gives me back a string of the html of the page