[英]httphandler in asp.net never gets called
我有一個運行在.net framework 2.0中並托管在IIS 7.5上的Web應用程序。 應用程序池以經典模式運行。 我想攔截所有包含.txt文件的請求。 以下是我在web.config中的條目
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<add name="NES.HiLo.Security.CommunityResource, NES.HiLo.Security" verb="*" path="*.txt" type="NES.HiLo.Security.CommunityResource, NES.HiLo.Security" />
</handlers>
</system.webServer>
<httpHandlers>
<add verb="*" path="*.txt" type="NES.HiLo.Security.CommunityResource, NES.HiLo.Security" />
</httpHandlers>
當我向網址發出請求時
http://local.mysite.com/media/CLT/ResourceUploads/1000277/Test1.txt
處理程序永遠不會踢進來,控件永遠不會進入處理程序中的代碼。
有什么想法我想念的嗎? 謝謝
根據MSDN在經典模式下在IIS 7.0中注冊處理程序的MSDN示例 ,您缺少幾個屬性:
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<add name="CommunityResourceHandler" verb="*" path="*.txt"
type="NES.HiLo.Security.CommunityResource, NES.HiLo.Security"
modules="IsapiModule"
scriptProcessor="FrameworkPath\aspnet_isapi.dll"
resourceType="File" />
</handlers>
</system.webServer>
<httpHandlers>
<add verb="*" path="*.txt" type="NES.HiLo.Security.CommunityResource, NES.HiLo.Security" />
</httpHandlers>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.