ASP.NET/IIS: Tell IIS do not check for file existence
In my Global.asax.cs
, I have:
routes.MapRoute("AssetCss", "css/{*path}",
new { controller = "Asset", action = "Index" });
I also have this in a view:
<link href="/css/Root/index.css" rel="stylesheet" type="text/css" />
The problem is that the AssetController
does not invoke Index
when /css/Root/index.css
is requested. This is because a file actually exists at the path /css/Root/index.css
.
If I recall correctly, there's a checkbox setting in IIS that basically says "Do not check that a file actually exists at the request path [instead, let the RouteTable
handle it]." (At least there is in IIS 6.)
Is there something 开发者_StackOverflow社区I can put in my Web.config that sets this IIS setting to true
? How do I tell IIS to let my MVC routes handle the path even if a file exists at the path?
Check out this site. It helped me with the the same problem.
http://blog.stevensanderson.com/2008/07/04/options-for-deploying-aspnet-mvc-to-iis-6/
精彩评论