How does one return an error in an aspx page method decorated with WebMethod
?
Sample Code
$.ajax({
type: "POST",
url: "./Default.aspx/GetData",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: AjaxSucceeded,
error: AjaxFailed
});
[WebMethod]
public static string GetData()
{
}
How does one return error from a webmethod? So one can be able to use the jquery error portion to show the error detail.
Response
object come from? The user's webmethod is returning a string. – Uniocular