简体   繁体   English

为什么我在这个aspx页面中看不到详细的错误消息?

[英]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. 这是默认值。

Warning 警告

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.

相关问题 ASPX页面看不到我的Web服务类的名称空间 - ASPX page can't see namespace of my Web Service class 为什么在项目目录中看不到扩展名为.aspx的文件,却看到带有.aspx.cs的文件? - Why can I see files with .aspx extension, but not files with .aspx.cs in my project directory? 为什么不能从内联ASPX代码块添加控件页面的页眉? - Why can't I add a control the page's header from the an inline ASPX code nugget? ASPX重定向到文件给出错误“此页面无法显示” - ASPX Redirect to a file gives error “This page can't be displayed” asp.net代码隐藏未看到在aspx页中声明的对象并导致生成错误 - asp.net code-behind doesn't see an object declared in aspx page and causes build error 如何创建详细的错误页面? - How do I create a detailed error page? 我看不到服务器错误的详细输出? - I am not being able to see a detailed output of a server error? 为什么我不能在.aspx中绑定属性,而在.xaml中是可行的 - Why can't I bind a property in .aspx while it is feasible in .xaml 为什么看不到我的照片? - Why can't I see my pictures? 在ASP.Net中,为什么不能从ASPX页面的构造函数访问服务器控件的属性? - In ASP.Net, why can't I access a server control's properties from the ASPX page's constructor?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM