詳細なエラーページレイアウトの素晴らしい例を探して、他の多くの質問を調べましたが、何も見つかりませんでした. 多くの人が以前にこれを作ったことがあると確信しています。
要件 * 例外情報 (タイプ、スタック トレース) を表示する必要があります * 可能であればフォームの値を表示する必要があります * 問題の原因となった領域/コントローラー/アクションを表示する必要があります
私が思いついた最高のものは次のとおりです。
@model System.Web.Mvc.HandleErrorInfo
@{ViewBag.Title = "Error";}
<h2>Sorry, an error occurred while processing your request.</h2>
<p>Please copy and paste this entire page in an email to
<a href="mailto:me@me.com?subject=Website%20Error">Me</a>
along with any other information you can provide so we can
get this fixed ASAP!</p>
@if (Model != null) {
<h1>@Model.Exception.GetType().Name<br />
thrown in @Model.ControllerName @Model.ActionName</h1>
<h2>Details</h2>
<div>
@Model.Exception.ToString()
</div>
}