简体   繁体   English

处理此类型的页面未提供错误

[英]Handle This type of page is not served error

I asked this question since no one got an answer, I have got no option but to fall back to less useful Plan B. I am using URL rewriting to prevent direct access to the .aspx page by using 我问了这个问题,因为没有人得到答案,我别无选择,只能退回到不那么有用的计划B。

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

This raises the error "This type of page is not served.", how can I instead redirect the user to my own custom handler page? 这会引发错误“不提供此类页面。”,我该如何将用户重定向到我自己的自定义处理程序页面? Is there some error code which I can use to redirect? 是否有一些我可以用来重定向的错误代码? I am looking for a web.config solution. 我正在寻找一个web.config解决方案。

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM