ASP.NET MVC Route: bypass staticfile handler for path

后端 未结 2 1516
感动是毒
感动是毒 2020-12-06 04:50

I\'ve been googling and tinkering for a couple hours and haven\'t really made much progress, so hopefully someone here can help.

I\'m trying to get all requests to a

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-06 05:15

    There are a couple options here.

    http://www.hanselman.com/blog/BackToBasicsDynamicImageGenerationASPNETControllersRoutingIHttpHandlersAndRunAllManagedModulesForAllRequests.aspx

    If you really want all requests running through the asp.net pipe then you need.

    
      
    
    

    Update

    Another option, especially if your need to bypass the static handler is constrained to a subset of your site, is to use the following

      
    

    Considering how on mvc sites, most static files are handled from a couple well known directories, this is a better option.

提交回复
热议问题