2013-12-23 2 views
1

저는 MVC4에서 newby입니다.MVC4의 이벤트 핸들러

protected void Application_Start() 
{ 
    AreaRegistration.RegisterAllAreas(); 

    //GlobalConfiguration.Configure(WebApiConfig.Register); 
    FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 
    RouteConfig.RegisterRoutes(RouteTable.Routes); 
    BundleConfig.RegisterBundles(BundleTable.Bundles); 
} 

내가 쓸 때 처리기를 호출하고 싶습니다 .../Stackoverflow하지만 항상 Stackoverflow 컨트롤러가 작동합니다. Stackoverflow 컨트롤러 호출을 중지하려면 어떻게해야합니까? 핸드 러를 호출하기를 원합니다.

아래 문을 web.config에 추가합니다.

<add name="MyHandler" verb="*" path="/Stackoverflow " type="Library.MyHander"/> 

답변

2
당신은 RegisterRoutes 방법이 줄을 추가, 그래서 그 경로를 무시해야합니다

:

routes.IgnoreRoute("Stackoverflow");