报错
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a fig" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="Off"/> </system.web> </configuration> |
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web> </configuration> |
这是因为配置文件隐藏了错误信息 首先应该在system.web节点下 加上
<customErrors mode="Off" defaultRedirect="error/error.html">
<error statusCode="403" redirect="error/error.htm" />
<error statusCode="404" redirect="error/error.htm" />
</customErrors>
这个表示 显示错误信息 然后展示错误页面
然后去掉这个节点的代码 <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
这个节点表示 即使运行时报错 我也不给你看 就给你展示上图贴的代码 只有在本地Localhost 才会显示错误
参考
本文发布于:2024-02-04 06:04:21,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170700621152925.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |