MVC3 アプリケーションにカスタム エラー ハンドラ クラス属性があります。これはExceptionContext
パラメーターとして受け取ります。エラーログを書いた後、error.htmlページにリダイレクトしたい。私は以下のように試しましたが、うまくいきません。何か提案はありますか?
context.Result = new RedirectResult("~/Error.html");
カスタム エラー ハンドラ
private static void LogUnhandledException(ExceptionContext context)
{
var e = context.Exception;
ErrorLog.Error(1, e.Message, e, "test");
// Redirect to Error Page
//context.Result = new RedirectResult("~/Error.htm");
context.Result = new FilePathResult("~/Error.htm", "text/html");
}
ありがとう