0
Clean way to catch all errors thrown in an MVC 3.0 application?に投稿されたソリューションのフィルタを使用していますが、どのように(/ Views/Account/ErrorPageにある単純なエラーページの)ビューにリダイレクトすることができますか? AccountController)、そのフィルタで?これは、以下に再現されています例外処理フィルタからのリダイレクト
public class HandleExceptionsAttribute : HandleErrorAttribute
{
public override void OnException(ExceptionContext filterContext)
{
var expception = filterContext.Exception;
// Go to generic error page:
}
}
ありがとうございました。 filterContext.Result
filterContext.Result = new ViewResult
{
ViewName = "<view name>",
ViewData = new ViewDataDictionary<HandleErrorInfo>(model),
TempData = filterContext.Controller.TempData
};
を設定
は ' ""'の構文がどうあるべきかというコールを取り込み、完全な方法がありますか?私は ''/Account/ErrorPage ''を試しましたが、"マスタが見つかりませんでした。または、検索エンジンが検索された場所をサポートしていません... "というエラーが発生しました。 –
ITWorker
共有ビュー – Fran