Possible Duplicate:
Call non-static method in server side(aspx.cs) from client side use javascript (aspx)
I have this following code that is working fine
function getFooObj() {
$.ajax({
type: "POST",
url: "Dummy.aspx/GetFooObj",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {
alert('good');
}
});
}
[WebMethod]
public static FooObj GetFooObj ()
{
// some code that returns FooObj
}
my question is if i want my WebMethod NOT to be static, how can i call it from JS?
[WebMethod]
public FooObj GetFooObj ()
{
// some code that returns FooObj
}