句柄此类页面未提供错误

时间:2012-07-16 05:01:44

标签: asp.net error-handling url-rewriting

我问这个question,因为没有人得到答案,我别无选择,只能回到不那么有用的计划B.我正在使用URL重写来防止使用<直接访问.aspx页面/ p>

<httpHandlers>
  <add verb="*" path="*.aspx" type="System.Web.HttpForbiddenHandler" />
</httpHandlers>

这会引发错误“此类页面未送达。”,我该如何将用户重定向到我自己的自定义处理程序页面?是否有一些我可以用来重定向的错误代码?我正在寻找一个web.config解决方案。

<error statusCode="" redirect="~/notfound.htm" />//What should I put the error code in here?

1 个答案:

答案 0 :(得分:1)

删除bin文件夹并重建解决方案解决了我的问题。