页面跳转 Server Error in '/' Application. --Runtime Error 错误

zg672313 2009-06-20 10:01:00
各位高手们:我在做网站时,遇到一个非常严重的问题:

如标题:不管我的页面跳转到哪个页面,用什么方式跳转,它都出现这个错误:
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>
我在本地测试时,没有任何错误,上传到服务器中,就会出现这个错误,而且每次都是一定出错,不是偶尔出现。

在服务器上面也捕获不到任何的错误。就直接蹦出这个错误。
希望高手们能不吝赐教。谢谢!!!
...全文
1796 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
沐雪架构师 2010-01-22
  • 打赏
  • 举报
回复
汗,我给客户做个系统,也出现这个问题。。。。晕死了。。。
zg672313 2009-06-21
  • 打赏
  • 举报
回复
谢谢楼上高手们的关心。这个网站以前就是偶尔出现一次这个错误,但这几天我加了一些功能,出现这个错误后,我在代码中加入了Try
{
}
catch()
{
}
块,来捕获错误,提示是:线程被中止。
凡是页面跳转部分,就是这个错误,在网站页面中我使用自定义控件,来传递参数,开始试着不传参数,不报错,但现在不传参数页面跳转也报错,网站的IIS重新注册我也使用了,不起作用。
yan286093636 2009-06-21
  • 打赏
  • 举报
回复
代码,配制,,不外呼着两个方面,一个一个找把>..
yzf86211861 2009-06-21
  • 打赏
  • 举报
回复
权限是否配置正确
gdjlc 2009-06-21
  • 打赏
  • 举报
回复
请使用记事本打开您程序中的Web.Config文件,增加“customErrors mode="Off"”参数设置。(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>

----------------以上是增加的参数内容----------------

增加以上参数后就能使如图1的“友好提示”显示出真实的程序报错信息。



一般就是代码的问题,另外有一次我代码没有问题,却老是出现这个问题,试了很多方法也没用,后来重新注册asp.net 2.0
就行了:
运行
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i
zg672313 2009-06-21
  • 打赏
  • 举报
回复
问题已经解决,配置没有问题,问题出在我在本地数据库表中有一字段中有数据,但在服务器上面的数据库表中这个字段没有数据库,读取出来的数据库为Null,所以直接就蹦出了上面的异常。而在我的程序中,也没有对这一字段的Null的情况作判断,使程序运行出现错误。不过大家对我的方法是正确的。马上结贴给分。谢谢各位!!!
cuike519 2009-06-21
  • 打赏
  • 举报
回复
错误你自己没有捕获,你可以把允许远程查看错误堆栈打开,这样你就能看到具体的错误信息。
mengxj85 2009-06-20
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 wuyq11 的回复:]
框架配置是否正确
程序是否有错误
权限是否配置正确
[/Quote]
Up
最有可能是程序错误,比如数据库连接的,有服务器上的连接跟本地不一样
wuyq11 2009-06-20
  • 打赏
  • 举报
回复
框架配置是否正确
程序是否有错误
权限是否配置正确
V68V6 2009-06-20
  • 打赏
  • 举报
回复
up

jf

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧