私はMVC2を使用していて、ユーザーにわかりやすいエラーメッセージを表示しようとしています。方法は次のとおりです。
public ActionResult Foo()
{
Response.StatusCode = 403;
return new ContentResult() { Content="frindly error"}
}
ただし、ajaxOnFailureコールバックでそれを読み取る方法を見つけるのに問題があります。
function ajaxErrorHandler(context) {
// this fires an error, saying it's not a JSON object
alert(context.get_response().get_object());
}
私はfirebugで応答が正しいことを見ることができます。何か案は?