ASP.NET MVC 사이트에서 AXD (Elmah)를 구성 요소로 통합하는 방법
-
23-08-2019 - |
문제
ASP.NET MVC 사이트에서 Elmah를 UP 및 실행 중이며 인터페이스를 사이트의 관리 페이지와 통합하고 싶습니다. 기본적으로 MVC 시스템 외부에서 실행되는 URL ~/ELMAH.AXD로 인터페이스를 호출합니다. 설치를 위해서는 MVC에 경로를 무시하도록 지시해야하므로 컨트롤러 나 Elmah에 대해 아는 것이 없습니다. 설치는 이미 기본적으로 무시 되더라도 특정 무시를 제안합니다.
public class MvcApplication : System.Web.HttpApplication {
public static void RegisterRoutes(RouteCollection routes) {
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("elmah.axd");
...
}
Elmah.axd를 사이트의 구성 요소로 통합하고 싶습니다. 나는 선물 도우미 html.renderroute를 사용하는 견해가있는 Elmah 컨트롤러를 가지고 있다고 생각하지만 어떤 인수가 통과할지 잘 모르겠습니다.
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>Elmah</h2>
<% Html.RenderRoute(???); %>
</asp:Content>
이것이 의미가 있습니까? URL을 html.renderroute로 전달하는 방법이 있습니까? html.renderroute를 사용하지 않는 더 좋은 방법이 있습니까?
해결책
대신 당신의 견해에서 이것을 시도하십시오.
<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>
다른 팁
또는 사이트에서 사용할 수 있습니다
제휴하지 않습니다 StackOverflow