Asp.net Web应用程序中的错误 [英] Error in Asp.net Web application

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

问题描述

亲爱的朋友们!

我已经使用Asp.net,c#,sqlserver 2005创建了一个Web应用程序,最后将其托管到IIS Webserver ..... and

面对这个错误的问题!请任何人可以告诉我如何解决此解决方案.

当我单击菜单"链接时,它显示了这样的错误.

Dear Friends !!

I have Created a Web application using Asp.net,c#,sqlserver 2005. and finally hosted this into IIS Webserver.....and

Am facing problem with this error !! Please can anybody can show me how to solve this solution.

When I click the Menu link its shows an error like this.

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>




所以,请给我建议一个好的解决方案.

等待您的解决方案..





So, Please advice me a good solution.

Waiting for your Solution..


Thanks in ADVANCE.

推荐答案

您正在从除应用程序托管的机器之外的机器上访问该页面.

如果您处于开发环境中,则可以打开远程错误,这将提供更多详细信息,包括有关错误发生原因的堆栈跟踪.

您可以在运行该应用程序的计算机上交替使用浏览器,因为现在是本地",您将在浏览器中看到详细错误输出.

最后,您可以在IIS框中设置远程调试.
You are accessing the page from a machine other than that hosted by the application.

If you are in a development environment you could turn remote errors on, which would give more details including stack trace as to why the error is occurring.

You could alternately use the browser on the machine running the application and you will get a detail error output in the browser as you are now ''local''.

And finally you could set up remote debugging on the IIS box.


web.config
< customerrors mode =打开" defaultredirect =〜/40X-ErrorFound.aspx">
<错误statuscode ="403" redirect =〜/403-new.aspx"/>
<错误statuscode ="404" redirect =〜/404-new.aspx"/>
</customerrors>

---
这是default.aspx
中的代码
< a target ="_ self" href ="abc.pdf">单击此处</a>


上面的代码在本地运行,但是在IIS中发布后,

你有什么建议吗
web.config
<customerrors mode="On" defaultredirect="~/40X-ErrorFound.aspx">
<error statuscode="403" redirect="~/403-new.aspx" />
<error statuscode="404" redirect="~/404-new.aspx" />
</customerrors>

---
this is code in default.aspx

<a target="_self" href="abc.pdf">click here</a>


above code is working in local, but after published in IIS it wont

do you have any suggestion


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

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