正在给公司做网站:http://www.long-site.com/web/about/xwzx.aspx
网站有时候可以访问,有时候不报错,同一个时候不同的地区的人有的可以浏览,有的无法浏览
实在没有办法了
报错如下:
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" encoding="utf-8" ?>
<configuration><appSettings></appSettings>
    
<system.web>    <!--  动态调试编译
          设置 compilation debug="true" 以启用 ASPX 调试。否则,将此值设置为
          false 将提高此应用程序的运行时性能。
          设置 compilation debug="true" 以将调试符号(.pdb 信息)
          插入到编译页中。因为这将创建执行起来
          较慢的大文件,所以应该只在调试时将此值设置为 true,而在所有其他时候都设置为
          false。有关更多信息,请参考有关
          调试 ASP.NET 文件的文档。
    -->
    <compilation 
         defaultLanguage="c#"
         debug="true"
    />    <!--  自定义错误信息
          设置 customErrors mode="On" 或 "RemoteOnly" 以启用自定义错误信息,或设置为 "Off" 以禁用自定义错误信息。 
          为每个要处理的错误添加 <error> 标记。          "On" 始终显示自定义(友好的)信息。
          "Off" 始终显示详细的 ASP.NET 错误信息。
          "RemoteOnly" 只对不在本地 Web 服务器上运行的
           用户显示自定义(友好的)信息。出于安全目的,建议使用此设置,以便 
           不向远程客户端显示应用程序的详细信息。
    -->
    <customErrors 
    mode="RemoteOnly" 
    />     <!--  身份验证 
          此节设置应用程序的身份验证策略。可能的模式是 "Windows"、 
          "Forms"、 "Passport" 和 "None"          "None" 不执行身份验证。 
          "Windows" IIS 根据应用程序的设置执行身份验证 
            (基本、简要或集成 Windows)。在 IIS 中必须禁用匿名访问。
          "Forms" 您为用户提供一个输入凭据的自定义窗体(Web 页),然后 
           在您的应用程序中验证他们的身份。用户凭据标记存储在 Cookie 中。
          "Passport" 身份验证是通过 Microsoft 的集中身份验证服务执行的,
           它为成员站点提供单独登录和核心配置文件服务。
    -->
    <authentication mode="Windows" />  <!--  授权 
           此节设置应用程序的授权策略。可以允许或拒绝不同的用户或角色访问
          应用程序资源。通配符: "*" 表示任何人,"?" 表示匿名
          (未经身份验证的)用户。
    -->    <authorization>
        <allow users="*" /> <!-- 允许所有用户 -->
            <!--  <allow     users="[逗号分隔的用户列表]"
                             roles="[逗号分隔的角色列表]"/>
                  <deny      users="[逗号分隔的用户列表]"
                             roles="[逗号分隔的角色列表]"/>
            -->
    </authorization>    <!--  应用程序级别跟踪记录
          应用程序级别跟踪为应用程序中的每一页启用跟踪日志输出。
          设置 trace enabled="true" 可以启用应用程序跟踪记录。如果 pageOutput="true",则
          在每一页的底部显示跟踪信息。否则,可以通过浏览 Web 应用程序
           根目录中的 "trace.axd" 页来查看
          应用程序跟踪日志。
    -->
    <trace
        enabled="false"
        requestLimit="10"
        pageOutput="false"
        traceMode="SortByTime"
localOnly="true"
    />    <!--  会话状态设置
          默认情况下,ASP.NET 使用 Cookie 来标识哪些请求属于特定的会话。
          如果 Cookie 不可用,则可以通过将会话标识符添加到 URL 来跟踪会话。
         若要禁用 Cookie,请设置 sessionState cookieless="true"。
    -->
    <sessionState 
            mode="InProc"
            stateConnectionString="tcpip=127.0.0.1:42424"
            sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
            cookieless="false" 
            timeout="20" 
    />    <!--  全球化
          此节设置应用程序的全球化设置。
    -->
  <globalization requestEncoding="gb2312" responseEncoding="gb2312" fileEncoding="gb2312" culture="zh-cn"/>
   
  <pages  
         validateRequest="false"         
         /> </system.web></configuration>谁能告诉我是什么原因啊,在线等,解决立刻给分,不够再加!!!!!!!!!

解决方案 »

  1.   

    我打开了跟踪功能怎么还是看不到出错信息啊
        <trace
            enabled="true"
            requestLimit="10"
            pageOutput="false"
            traceMode="SortByTime"
    localOnly="false"
        />
      

  2.   

    <customErrors 
        mode="RemoteOnly" 
        /> 改为<customErrors 
        mode="off" 
        /> 
      

  3.   

    <customErrors 
        mode="RemoteOnly" 
        /> 改为<customErrors 
        mode="off" 
        /> 
    这里改好之后还是有问题啊
      

  4.   

    现在提示这个错误:
    Server Error in '/' Application.
    --------------------------------------------------------------------------------Object reference not set to an instance of an object. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  Stack Trace: 
    [NullReferenceException: Object reference not set to an instance of an object.]
       Asp600.AboutAdmin.AdminImage.admin_news_file.Page_Load(Object sender, EventArgs e)
       System.Web.UI.Control.OnLoad(EventArgs e) +67
       System.Web.UI.Control.LoadRecursive() +35
       System.Web.UI.Page.ProcessRequestMain() +731 
    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET 
    是什么原因啊?????
      

  5.   

    把Asp600.AboutAdmin.AdminImage.admin_news_file.Page_Load(Object sender, EventArgs e)贴出来,确认所有的对象都生成了
      

  6.   

    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using WebClassOne;namespace Asp600.AboutAdmin.AdminImage
    {
    /// <summary>
    /// admin_news_file 的摘要说明。
    /// </summary>
    public class admin_news_file : System.Web.UI.Page
    {
    protected System.Web.UI.WebControls.HyperLink HyperLink2;
    protected System.Web.UI.WebControls.Label LabelPic;
    protected System.Web.UI.WebControls.Panel PanelImages;
    protected System.Web.UI.WebControls.Label Label1;
    protected System.Web.UI.WebControls.HyperLink HyperLink1;
    protected System.Web.UI.HtmlControls.HtmlTable TABLE1;
    public AboutFileUp recordup=new AboutFileUp();
    public int imageid;
    public string filename;
    public int maxnum;
    public string tablename;
    public string tablefield;
    public string imagefile;
    public string aboutype;

    private void Page_Load(object sender, System.EventArgs e)
    {
    aboutype=Request.QueryString["aboutype"].ToString();
    if (aboutype=="1")
    {
    tablename="News_List";
    tablefield="NewsId";
    imagefile="AboutNewsFile";
    maxnum=5;
    }  
    if (aboutype=="2")
    {
    tablename="Prod_List";
    tablefield="ProdId";
    imagefile="ProdListFile";
    maxnum=1;

    if (aboutype=="3")
    {
    tablename="Site_Winpop";
    tablefield="WinpopId";
    imagefile="WinpopFile";
    maxnum=1;


    DataSet recordset=new DataSet();
    recordset=recordup.NewsListF(Convert.ToInt32(Request.QueryString["id"]),tablename,tablefield);
                imageid=Convert.ToInt32(recordset.Tables[tablename].Rows[0][0].ToString());
    filename=recordset.Tables[tablename].Rows[0][1].ToString();
    HyperLink2.NavigateUrl="admin_news_fileup.aspx?id="+imageid+"&aboutype="+aboutype;
    if (filename!="")
    {
    PanelImages.Visible=true;
    TABLE1.Visible=false;
    }
    else
    {
    PanelImages.Visible=false;
    TABLE1.Visible=true;
    }
    if (filename!="")
    {
    HyperLink2.Visible=false;
    }
    LabelPic.Text="<TABLE borderColor=#6595d6 cellSpacing=0 cellPadding=2 width=97% border=1>";
            LabelPic.Text+="<TR>";
    LabelPic.Text+="<TD width=50% align=center>文件浏览:<a href='../../JianImages/"+imagefile+"/"+filename+"' target=_blank>"+filename+"</a> </TD>";
    LabelPic.Text+="<TD width=30% align=left><a href=admin_news_fileedit.aspx?id="+imageid+"&aboutype="+aboutype+">[编辑]</a><a href=admin_news_filedel.aspx?id="+imageid+"&aboutype="+aboutype+"&filename="+filename+">[删除]<a></TD>";
    LabelPic.Text+="</TR>";
    LabelPic.Text+="</TABLE>";
    } #region Web 窗体设计器生成的代码
    override protected void OnInit(EventArgs e)
    {
    //
    // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
    //
    InitializeComponent();
    base.OnInit(e);
    }

    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {    
    this.Load += new System.EventHandler(this.Page_Load); }
    #endregion
    }
    }已经帖出来了  这里有问题吗?
    思归老大亲自来,第一次,荣幸啊 
      

  7.   

    which line? are you sure Request.QueryString["aboutype"] is not null?tryaboutype=Request.QueryString["aboutype"];
    if (aboutype == null)
      aboutype = "";
      

  8.   

    目前确认aboutype肯定不为空
    问题是目前我的站点有时候能够访问  有时候不能访问 
    并且同一个时间有的地区能够访问 有的地区不能访问(访问静态页面没有问题)
    是不是我哪里设置有问题啊 
    web.config已经帖出
      

  9.   

    >>>NullReferenceException是null对象的问题,在你的Page_Load里加个try/catchRequest.QueryString["aboutype"]Request.QueryString["id"]