I have a routed page with url like http://www.example.com/2/2332/example Now when i give a period in the url http://www.example.com/2/2332/example. I am taken to the server error page:
我有一个带有url的路由页面,例如http://www.example.com/2/2332/example现在,当我在网址http://www.example.com/2/2332/example中给出句点时。我被带到服务器错误页面:
HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
HTTP 404.您正在查找的资源(或其中一个依赖项)可能已被删除,名称已更改或暂时不可用。请查看以下网址,并确保拼写正确。
I would like to redirect to the same page http://www.example.com/2/2332/example or my custom 404 error page http://www.example.com/404.aspx.
我想重定向到同一页面http://www.example.com/2/2332/example或我的自定义404错误页面http://www.example.com/404.aspx。
I tried debugging but its not hitting the Application_Error event in the Global.asax.cs.
我试过调试但它没有在Global.asax.cs中遇到Application_Error事件。
Any help to solve this issue?
有什么帮助解决这个问题?
1 个解决方案
#1
2
The breakpoint is not hit because it is not an asp.net error. It is an IIS error. You have to modify web.config to redirect to a custom error page.
断点未被命中,因为它不是asp.net错误。这是一个IIS错误。您必须修改web.config才能重定向到自定义错误页面。
#1
2
The breakpoint is not hit because it is not an asp.net error. It is an IIS error. You have to modify web.config to redirect to a custom error page.
断点未被命中,因为它不是asp.net错误。这是一个IIS错误。您必须修改web.config才能重定向到自定义错误页面。