Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8295831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:44:43+00:00 2026-06-08T14:44:43+00:00

My app : VS2010, MVC3, C#, latest ELMAH Case : some errors happens (e.g.

  • 0

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>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T14:44:44+00:00Added an answer on June 8, 2026 at 2:44 pm

    It is an event in Elmah ErrorLog module, that can be handled in Global.asax.cs:

    protected void ErrorLog_Logged(object sender, ErrorLoggedEventArgs args)
    {
        Session["ElmahId"] = args.Entry.Id;
    }
    

    Then we can use stored id to navigate to error (I am using Elmah.Mvc module that implements special controller instead of default elmah pages). In Error.cshtml:

    @if (User.IsInRole(renweb.Constants.ROLE_ADMIN))
    {
          <a href="@Url.Action("Detail","Elmah",new{id=@Session["ElmahId"]})">Error details</a>
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use VS2010, C# to develop ASP.NET web app, I create some sessions in
I am trying to 'build' my MVC3 web app in VS2010 however keep getting
I'm using VS2010 and I'm deploying my MVC3 app to my webserver. I went
I have an asp.net mvc3 Razor app being developed in VS2010 using Git for
Building an offline web app in VS2010. I have a master page with a
I use VS2010,C# to develop my ASP.NET web app, I'm creating a vote page
I created a blank MVC 3 application on VS2010 SP1, and set the app
I'm working on an ASP.NET web app in VS2010,C#. I've created a table for
I moved my app from silverlight 3 VS2010 to a system having Silverlight 4
I have an MVC2 app I developed with the VS2010 RC and the .NET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.