i m 采用MVC2,并试图向用户展示一个友好的错误信息。
public ActionResult Foo()
{
Response.StatusCode = 403;
return new ContentResult() { Content="frindly error"}
}
然而,在Ajax OnFailure呼号上难以找到读书:
function ajaxErrorHandler(context) {
// this fires an error, saying it s not a JSON object
alert(context.get_response().get_object());
}
I can see in firebug that the response is correct. Any ideas?