各位高手们:我在做网站时,遇到一个非常严重的问题:    如标题:不管我的页面跳转到哪个页面,用什么方式跳转,它都出现这个错误:
     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> 
我在本地测试时,没有任何错误,上传到服务器中,就会出现这个错误,而且每次都是一定出错,不是偶尔出现。在服务器上面也捕获不到任何的错误。就直接蹦出这个错误。
希望高手们能不吝赐教。谢谢!!!

解决方案 »

  1.   

    请使用记事本打开您程序中的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 
      

  2.   

    谢谢楼上高手们的关心。这个网站以前就是偶尔出现一次这个错误,但这几天我加了一些功能,出现这个错误后,我在代码中加入了Try
    {
    }
    catch()
    {
    }
    块,来捕获错误,提示是:线程被中止。
    凡是页面跳转部分,就是这个错误,在网站页面中我使用自定义控件,来传递参数,开始试着不传参数,不报错,但现在不传参数页面跳转也报错,网站的IIS重新注册我也使用了,不起作用。
      

  3.   

    问题已经解决,配置没有问题,问题出在我在本地数据库表中有一字段中有数据,但在服务器上面的数据库表中这个字段没有数据库,读取出来的数据库为Null,所以直接就蹦出了上面的异常。而在我的程序中,也没有对这一字段的Null的情况作判断,使程序运行出现错误。不过大家对我的方法是正确的。马上结贴给分。谢谢各位!!!