How to call a non static void function from ajax.I am getting a error. This is ajax code:-
$('#button2 button').click(function () {
$.ajax({
type: "POST",
url: "practiced_final.aspx/display",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
success: function ()
{
},
error: function (a, b, c) {
alert(a + b + c);
}
})
return false;
});
This is C# method code:
[WebMethod]
protected void display()
{
HttpContext.Current.Response.Write( "Hello");
}
This is error message:-
[object XMLHttpRequest]errorundefined
What i am missing?
Please help.
Thank you.