ASP.NET MVC routing and static data (ie. images, scripts, etc)

前端 未结 3 1591
粉色の甜心
粉色の甜心 2021-01-05 14:14

If I have a request for a resource in my ASP.NET MVC1 (or 2) web app for a static resource, say ... an image or a javascript file or a css file ... does the .NET framework t

3条回答
  •  礼貌的吻别
    2021-01-05 14:24

    You can also do a little trick in IIS. I store my js, images, css etc in the Content folder underneath the virtual directory.

    If you then view properties (in IIS manager) of the Content folder, create it as a virtual directory, then remove the Wildcard mapping. Then set the Content folder back to a normal directory. This should then stop requests to these files being handled by the aspnet_isapi handler.

提交回复
热议问题