共享主机<customerrors mode =“关闭”>错误</customerrors>

时间:2014-03-10 13:47:31

标签: asp.net sql custom-errors

我在本地创建了非常简单的Web表单应用程序。我只在几页使用了sql连接。它工作正常。

但我上传网站分享托管我收到此错误。

Server Error in '/' Application.

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 "web.config" 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>

我的web.config文件

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <location path="httpdocs">
    <appSettings>
      <add key="ConnectionString.SQL Server (SqlClient)" value="connection string"/>
    </appSettings>
    <system.web>
      <deployment retail="false"/>
      <httpRuntime targetFramework="4.0"/>
      <compilation targetFramework="4.0" debug="true"/>
      <anonymousIdentification enabled="true"/>
      <pages validateRequest="false" enableEventValidation="false" controlRenderingCompatibilityVersion="4.0"/>
      <customErrors mode="Off"/>
    </system.web>
  </location>

</configuration>

我得到此错误只能尝试使用sql连接页面。例如我的主页没有使用任何sql连接,并且它运行良好。但是关于页面从sql server获取数据,并且它无法正常工作,请给出此错误。

winglas.net/Hakkimizda.aspx

您可以在该链接中看到错误。

谢谢你们!

0 个答案:

没有答案