好的,我现在感觉像个 nincompoop 一样问这个。
我写了一个简单的空白HttpHandler
,只是在方法中放了一个断点ProcessRequest
,然后在我的 web.config 中写了这个样板注册标记。
<system.web>
<httpHandlers>
<add path = "*.jpg" verb = "*" type="MyProject.BaseServices.StaticAssetHttpHandler, MyProject.BaseServices" validate = "false" />
<add path = "*.jpeg" verb = "*" type="MyProject.BaseServices.StaticAssetHttpHandler, MyProject.BaseServices" validate = "false" />
<add path = "*.png" verb = "*" type="MyProject.BaseServices.StaticAssetHttpHandler, MyProject.BaseServices" validate = "false" />
<add path = "*.bmp" verb = "*" type="MyProject.BaseServices.StaticAssetHttpHandler, MyProject.BaseServices" validate = "false" />
<add path = "*.gif" verb = "*" type="MyProject.BaseServices.StaticAssetHttpHandler, MyProject.BaseServices" validate = "false" />
<add path = "*.ico" verb = "*" type="MyProject.BaseServices.StaticAssetHttpHandler, MyProject.BaseServices" validate = "false" />
<add path = "*.css" verb = "*" type="MyProject.BaseServices.StaticAssetHttpHandler, MyProject.BaseServices" validate = "false" />
<add path = "*.js" verb = "*" type="MyProject.BaseServices.StaticAssetHttpHandler, MyProject.BaseServices" validate = "false" />
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers>