c# - ASP.NET MVC Route: bypass staticfile handler for path -
i've been googling , tinkering couple hours , haven't made progress, here can help.
i'm trying requests path handled 3rd party component.
edit , need requests other paths behave normally.
i'm using route handler wildcard mapping this:
routes.add(new route("pathiwant/{*everythingelse}", new myroutehandler()));
all traditional routes forward correctly handler, forwards nicely 3rd party component. when hit static files (.html, .txt, etc.), picked staticfile handler instead of handler, i'm attempting turn off staticfile handler (simplified):
<system.webserver> <handlers> <remove name="staticfile"/> </handlers> </system.webserver>
this turns off staticfile handler, mvc still doesn't pick route.
i'd prefer not fall on creating own handler , injecting asp request stack since seems there should mvc-happy way this.
any thoughts? , thanks.
there couple options here.
if want requests running through asp.net pipe need.
<system.webserver> <modules runallmanagedmodulesforallrequests="true" /> </system.webserver>
update
another option, if need bypass static handler constrained subset of site, use following
<add name="apiuris-isapi-integrated-4.0" path="/subdirectory/*" verb="get,head,post,debug,put,delete,patch,options" type="system.web.handlers.transferrequesthandler" precondition="integratedmode,runtimeversionv4.0" />
considering how on mvc sites, static files handled couple known directories, better option.
Comments
Post a Comment