My app: VS2010, MVC3, C#, latest ELMAH
Case: some errors happens (e.g. null reference), custom error page is shown (customErrors mode="On").
Task: allow admins (users in role Admins, ) view error detail from custom error page
Question: How to obtain/pass elmah error id to the custom error page view ?
Upd: Related answered question: ELMAH - Using custom error pages to collecting user feedback
Custom error page sample:
@model System.Web.Mvc.HandleErrorInfo
@{
ViewBag.Title = "Error";
}
<h2>
Error processing a request.
@if (User.IsInRole(MyAppNamespace.Constants.ROLE_ADMIN))
{
// where to obtain ELMAH error id to navigate to error details ?
// elmah/detail?id=291f5e83-5756-43bf-a889-07a548727da7
<a href="@Url.Content("~/elmah")">View error details</a>
}
</h2>