7

I have Elmah up and running in my ASP.NET MVC site and I would like to integrate its interface with the administration pages of the site. By default, you invoke the interface with the url ~/elmah.axd, which runs outside the MVC system. The installation requires you to tell MVC to ignore the route, so there's no controller or anything that knows about elmah. The installation suggest a specific ignore, even though it is already ignored by default:

public class MvcApplication : System.Web.HttpApplication {
    public static void RegisterRoutes(RouteCollection routes) {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
        routes.IgnoreRoute("elmah.axd");
...
}

I would like to try integrating elmah.axd as a component of the site. I'm thinking to have a Elmah controller with a view that uses the Futures helper Html.RenderRoute but I'm not sure what arguments to pass:

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Elmah</h2>
    <% Html.RenderRoute(???); %>
</asp:Content>

Does this make sense - is there a way to pass the url in to Html.RenderRoute? Is there a better way that doesn't use Html.RenderRoute?

keithm
  • 2,813
  • 3
  • 31
  • 38

2 Answers2

7

Try this in your View instead:

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Elmah</h2>
    <iframe src="<%= Url.Content("~/elmah.axd") %>" frameborder=no width=100% scrolling=auto>
    </iframe>
</asp:Content>
eu-ge-ne
  • 28,023
  • 6
  • 71
  • 62
  • 1
    Thanks for this - iframe works great. I got so caught up in controllers n stuff that I forgot about straight HTML. – keithm Jul 06 '09 at 12:47
1

or you can use this on your site

Elmah Error Log Application

Vijayant Katyal
  • 642
  • 2
  • 12
  • 22