[英]Why can't i see a detailed error message in this aspx page?
I have a aspx page and it displays custom error but i can't see a detailed error message. 我有一个aspx页面 ,它显示自定义错误,但我看不到详细的错误消息。 My web.config looks like this,
我的web.config看起来像这样,
<?xml version="1.0"?>
<configuration>
<appSettings />
<connectionStrings />
<system.web>
<compilation debug="true" />
<authentication mode="Windows" />
<customErrors mode="On" />
</system.web>
</configuration>
To see the error you need customErrors off , like this: 要查看错误,您需要关闭 customErrors ,如下所示:
<customErrors mode="Off"></customErrors>
From the docs , here are the options for the mode
attribute: 从文档中 ,以下是
mode
属性的选项:
- On - Specifies that custom errors are enabled.
开 - 指定启用自定义错误。 If no defaultRedirect attribute is specified, users see a generic error.
如果未指定defaultRedirect属性,则用户会看到一般错误。 The custom errors are shown to the remote clients and to the local host.
自定义错误显示给远程客户端和本地主机。
- Off - Specifies that custom errors are disabled.
关 - 指定禁用自定义错误。 The detailed ASP.NET errors are shown to the remote clients and to the local host.
详细的ASP.NET错误将显示给远程客户端和本地主机。
- RemoteOnly - Specifies that custom errors are shown only to the remote clients, and that ASP.NET errors are shown to the local host.
RemoteOnly - 指定仅向远程客户端显示自定义错误,并向本地主机显示ASP.NET错误。 This is the default value.
这是默认值。
Setting Off
on a live-production site is very risky as some error messages might compromise sensitive data on your site (like code and paths maybe even passwords). 在实时生产站点上设置
Off
是非常危险的,因为某些错误消息可能会危害您站点上的敏感数据(例如代码和路径甚至密码)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.