0
我見過幾篇關於Application_BeginRequest
的帖子,但非似乎有我的問題。Application_BeginRequest呼籲圖像
我的Application_BeginRequest
正在我的網站上的每個圖像被調用。
StaticFileHandler
使用*作爲路徑,但它在列表的末尾。
這是正常的行爲?或者我應該在列表頂部添加.gif
,.jpg
等等?
這是在我的IIS7.5 Win7開發服務器上。沒有在生產服務器上檢查它。
更新: 設置runAllManagedModulesForAllRequests="false"
會有所幫助。但是,然後ASP.NET URL映射不再工作。我試圖直接禁用它的圖像,但沒有效果?
<location path="Resources">
<system.webServer>
<modules runAllManagedModulesForAllRequests="false">
</modules>
</system.webServer>
<location>
我想這會有所幫助,但後來我的網址映射代碼將不再工作。至少這是發生的事情。 我試圖做到這一點的圖像目錄,就像在更新後的問題,但這並不工作或不幸。 – Remy 2010-07-26 10:25:40
@Remy你在說什麼「URL映射代碼」? MVC路由,一個URL重寫模塊,或其他?如果是前者,請查看[此鏈接](http://www.britishdeveloper.co.uk/2010/06/dont-use-modules-runallmanagedmodulesfo.html)。 – Michael 2014-02-24 16:51:20