【发布时间】:2014-11-04 16:18:24
【问题描述】:
在 asp.net 中使用 Visual Studio。 我正在尝试放置我使用此代码的自定义错误页面 -
<customErrors mode="RemoteOnly" defaultRedirect="~/ErrorPages/errorPage.aspx" >
<error statusCode="404" redirect="~/ErrorPages/NotFound.aspx" />
</customErrors>
我创建了错误页面。 我也在 global.asax 页面上找到了这段代码 -
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
Dim mailClass As New MultiUseFunctions()
Dim objErr As SystemException = Server.GetLastError().GetBaseException()
Dim errorContent As String = the error msg code
mailClass.sendMail(errorContent, "User Error Info", "the mail address", "Nothing")
End Sub
我确实在我的邮件中收到了错误消息,但是 -->
现在这是我的问题: 当我遇到错误(例如错误的 url 类型)并重定向到 notFound 错误页面时,我可能会陷入无限循环?无论我点击什么网站都不会移动到其他页面,它只是停留在该页面上。 知道什么可能导致这种情况吗?
提前致谢!
【问题讨论】:
-
由于卡在
NotFound.aspx页面,请检查该页面包含的链接是否损坏。
标签: asp.net vb.net custom-errors