ASP.NET/IIS: Tell IIS do not check for file existence

Posted by AgileMeansDoAsLittleAsPossible on Stack Overflow See other posts from Stack Overflow or by AgileMeansDoAsLittleAsPossible
Published on 2011-01-05T00:49:02Z Indexed on 2011/01/05 0:53 UTC
Read the original article Hit count: 205

Filed under:
|
|

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 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?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about mvc