Web应用程序中的服务器错误 [英] Server Error in Web Application.

查看:154
本文介绍了Web应用程序中的服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将我的网页上传到服务器并在我检查错误后。实际上我编码,将excel表内容导入服务器表。用户需要浏览并选择系统中的Excel工作表,并在代码中我正在读取Excel工作表字段并将数据存储到服务器表中。当我浏览并选择Excel表格并导入时收到以下错误。





描述:服务器上发生应用程序错误。此应用程序的当前自定义错误设置可防止远程查看应用程序错误的详细信息(出于安全原因)。但是,它可以由运行在本地服务器计算机上的浏览器查看。 

详细信息:要在远程计算机上查看此特定错误消息的详细信息,请创建< customErrors > 标记位于当前Web应用程序根目录中的web.config配置文件中。此< customErrors > 标记应该然后将其mode属性设置为Off。


<! - Web.Config配置文件 - >

< 配置 >
< system.web >
< customErrors mode = / >
< / system。网站 >
< / configuration >

注意:您看到的当前错误页面可以替换为自定义错误页面通过修改应用程序的< customErrors > 配置标记指向自定义错误页面URL。


<! - Web.Config配置文件 - >

< 配置 >
< system.web >
< customErrors mode = RemoteOnly defaultRedirect = mycustompage.htm < span class =code-keyword> / >
< / system.web >
< / configuration >

解决方案

请在您的webconfig文件中使用此代码





 <   customErrors     mode   =     defaultRedirect   =  GenericErrorPage.htm >  
< ; 错误 statusCode = 403 重定向 = NoAccess.htm / >
< span class =code-keyword>< 错误 statusCode = 404 重定向 = FileNotFound.htm / >
< ; / customErrors >


Hi, when i Uploaded my webpage into server and after i checking getting error. Actually i coded, to import the excel sheet contents into server table. the user need to browse and select the excel sheet in their system and in code i am reading the excel sheet fields and storing the data into server table. while i browse and select the Excel Sheet and importing getting the following 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>

解决方案

Please Use this Code in your webconfig file


<customErrors mode="Off" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm"/>
            <error statusCode="404" redirect="FileNotFound.htm"/>
        </customErrors>


这篇关于Web应用程序中的服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆