2011-02-11 111 views
0

HI,服務器事件日誌警告

我收到警告消息。我dono爲什麼?但在我的本地工作很好。我的機器事件日誌中沒有警告。誰能幫我???這裏是我的事件日誌警告..

Log Name:  Application Source:  ASP.NET 2.0.50727.0 Date:   

2011年2月11日上午9時54分46秒事件ID:
1309年任務類別:Web事件級別:
警告關鍵字:經典用戶:
不適用計算機:
PACDCPCCOMA01.cable.comcast.com 說明:事件代碼:3005事件 消息:未處理的異常已發生 發生。事件時間:2011年2月11日 上午9時54分46秒事件時間(UTC): 2011年2月11日下午2時54分46秒事件ID: b60b4cc9c1c941a59414965489a83629 事件序列:79355事件發生 :1個事件詳細代碼:0
應用程序信息: 應用程序域:/ LM/W3SVC/1/ROOT-1-129418968817826366 信任級別:全 應用程序虛擬路徑:/ 應用程序路徑:C:\的Inetpub \ wwwroot的\ OM \ 機名稱:PACDCPCCOMA01進程信息: 進程ID:3912 進程名稱:w3wp.exe 帳戶名稱:IIS APPPOOL \ Classic .NET AppPool異常信息:

Exception type: NullReferenceException 
Exception message: Object reference not set to an instance of an 

object。索取信息: 請求URL:http://ccom/EditWinAttachments.aspx?id=1

Request path: /EditWinAttachments.aspx 
User host address: 10.163.26.31 
User: CABLE\HAlmei001 
Is authenticated: True 
Authentication Type: Negotiate 
Thread account name: IIS APPPOOL\Classic .NET AppPool Thread 

信息: 線程ID:4 線程帳戶名稱:IIS APPPOOL \經典.net應用程序池 正在模擬:假 堆棧跟蹤:在EditWinAttachments.gvAtt_ItemDataBound(對象 發件人,GridItemEventArgs e)如 C:\ Documents和 設置\ bpucha1103c \桌面\最新 代碼\ CCOM_PROD \ CellBackHaul \ EditWinAttachments.aspx.cs:線 113在 Telerik.Web.UI.RadGrid.OnItemDataBound(GridIt emEventArgs e)上 Telerik.Web.UI.GridItem.SetupItem(布爾 數據綁定,在 Telerik.Web.UI.GridItemBuilder.InitializeItem(的Int32 dataSourceIndex,字符串對象的DataItem, 的GridColumn []欄, 的ControlCollection行) & nextItemHierarchicalIndex,布爾& itemIsInEditMode)在 Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext 組)在 Telerik.Web.UI.GridTableView.CreateItems(IEnumerator的 枚舉,的GridColumn []欄, 的ControlCollection對照)在 Telerik.Web.UI.GridTableView.CreateControlHierarchy(布爾 useDataSource)在 Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable的 的dataSource,布爾useDataSource)
在 System.Web.UI.WebControls.CompositeDataBoundControl。在在 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments 參數, DataSourceViewSelectCallback回調) System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable的 數據)PerformDataBinding(IEnumerable的 數據)在 的System.Web .UI.WebControls.DataBoundControl.PerformSelect() 在 Telerik.Web.UI.GridTableView.PerformSelect() 在 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() 在 Telerik.Web.UI.GridTableView .DataBind() at Telerik.Web.UI.RadGrid.DataBind()用C 在EditWinAttachments.Page_Load(對象 發件人,EventArgs的):\文件 和 設置\ bpucha1103c \桌面\最新 代碼\ CCOM_PROD \ CellBackHaul \ EditWinAttachments.aspx.cs:線39在 的System.Web .Util.CalliHelper.EventArgFunctionCaller(IntPtr的 FP,對象O,對象噸,EventArgs的)
在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(對象 發件人,EventArgs e)上 System.Web.UI.Control .OnLoad(EventArgs e)at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(布爾 includeStagesBeforeAsyncPoint,布爾 includeStagesAfterAsyncPoint) 自定義事件詳細信息:

事件XML: 0x80000000000000 應用 PACDCPCCOMA01.cable。 comcast.com 發生未處理的異常。 2011年2月11日上午九時54分46秒 2011年2月11日下午2點54分46秒 b60b4cc9c1c941a59414965489a83629/LM/W3SVC/1/ROOT-1-129418968817826366 全 / C:\的Inetpub \ wwwroot的\ OM \ PACDCPCCOMA01 的w3wp.exe IIS APPPOOL \經典.net程序池 的NullReferenceException 對象引用不設置爲一個對象的一個​​實例。 HTTP://ccom/EditWinAttachments.aspx ID = 1 /EditWinAttachments.aspx 10.163.26.31 CABLE \ HAlmei001 真 協商 IIS APPPOOL \經典.net程序池 IIS APPPOOL \經典.net程序池 ?在EditWinAttachments.gvAtt_ItemDataBound(對象 發件人,GridItemEventArgs e)如 ç假 :\ Documents和 設置\ bpucha1103c \桌面\最新 代碼\ CCOM_PROD \ CellBackHaul \ EditWinAttachments.aspx.cs:線 113在 Telerik.Web .UI.RadGrid.OnItemDataBound(GridItemEventArgs 01 e)在 Telerik.Web.UI.GridItem。SetupItem(布爾 數據綁定,對象的DataItem, 的GridColumn []欄, 的ControlCollection行)在 Telerik.Web.UI.GridItemBuilder.InitializeItem(的Int32 dataSourceIndex,字符串& nextItemHierarchicalIndex, 布爾& itemIsInEditMode)在 Telerik.Web .UI.GridItemBuilder.CreateItems(GridGroupingContext 組)在 Telerik.Web.UI.GridTableView.CreateItems(IEnumerator的 枚舉,的GridColumn []欄, 的ControlCollection對照)在 Telerik.Web.UI.GridTableView.CreateControlHierarchy(布爾 useDataSo urce)處 System.Web.UI.WebControls Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable的 的dataSource,布爾useDataSource)
在 System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable的 數據) .DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable的 數據)在 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments 參數, DataSourceViewSelectCallback回調) 在 System.Web.UI.WebControls.DataBoundControl.PerformSelect() 在 Telerik的。 Web.UI.GridTableView.PerformSelect() 在 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() 在 Telerik.Web.UI.GridTableView.DataBind() 在Telerik.Web.UI.RadGrid.DataBind()
在EditWinAttachments.Page_Load(在C對象 發件人,EventArgs的):\文件 和 設置\ bpucha1103c \桌面\最新 代碼\ CCOM_PROD \ CellBackHaul \ EditWinAttachments.aspx.cs:線 39在 錯誤幫助( IntPtr fp,Object o,Object t,EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy。在 System.Web.UI.Control.OnLoad在 System.Web.UI.Control.LoadRecursive() (EventArgs的 e)上 System.Web.UI.Page.ProcessRequestMain回調(對象 發件人,EventArgs的) (布爾 includeStagesBeforeAsyncPoint,布爾 includeStagesAfterAsyncPoint)

protected void Page_Load(object sender, EventArgs e) 
{ 
    if (!IsPostBack) 
    { 
     if (Request.QueryString.Count > 0) 
     { 
      if (Request.QueryString[0].ToString() == "1") 
      { 
       gvAtt.ClientSettings.Scrolling.ScrollHeight = Unit.Pixel(400); 
      } 
     } 
     lblMsg.Text = ""; 
     if (Session["selorderID"] != null) 
     { 
      DBLayer obj = new DBLayer(); 
      SqlCommand cmd = new SqlCommand(); 
      SqlParameter param = new SqlParameter("@forderId", SqlDbType.NVarChar, 255); 
      param.Value = Session["selorderID"].ToString(); 
      param.Direction = ParameterDirection.Input; 
      cmd.Parameters.Add(param); 
      DataSet dsGetAtt = obj.ExecuteDatasetSql("[usp_GetOrderAttachments]", cmd); 
      gvAtt.DataSource = dsGetAtt; 
      gvAtt.DataBind(); 
      //Session["RGAtt"] = dsGetAtt; 
     } 

     clsTaskUpdates_BL objBL = new clsTaskUpdates_BL(); 
     ddlAttCat.DataSource = objBL.getAttCate_BL(); 
     ddlAttCat.DataTextField = "Desc"; 
     ddlAttCat.DataValueField = "ID"; 
     ddlAttCat.DataBind(); 
     ListItem lst = new ListItem("Please Select", "0"); 
     ddlAttCat.Items.Insert(0, lst); 

     ddlAttLvl.DataSource = objBL.getAttLvl_BL(); 
     ddlAttLvl.DataTextField = "Desc"; 
     ddlAttLvl.DataValueField = "ID"; 
     ddlAttLvl.DataBind(); 
     ListItem list = new ListItem("", "0"); 
     ddlAttLvl.Items.Insert(0, list); 
     ddlAttLvl.Items.FindByText("ORDER").Selected = true; 
    } 

} 

protected void gvAtt_ItemCommand(object sender, GridCommandEventArgs e) 
{ 
    if (e.CommandName == "AttaPath") 
    { 
     GridDataItem dataitem = e.Item as GridDataItem; 
     string strPath = dataitem["AttachmentPath"].Text.Trim(); 

     System.IO.FileInfo targetFile = new System.IO.FileInfo(strPath); 
     if (targetFile.Exists) 
     { 
      Response.Clear(); 
      Response.AddHeader("Content-Disposition", "attachment; filename=" + e.CommandArgument.ToString()); 
      Response.ContentType = "application/octet-stream"; 
      Response.WriteFile(targetFile.FullName); 
      Response.Flush(); 
      Response.Close(); 
     } 
     else 
     { 
      clsTaskUpdates_BL objBL = new clsTaskUpdates_BL(); 

      gvAtt.DataSource = objBL.getAttachments_Bl(Session["selorderID"].ToString()); 
      gvAtt.DataBind(); 
      ScriptManager.RegisterClientScriptBlock(this.upEditWinAddAtt, this.GetType(), "strSear", "alert('The requested attachment is moved/ deleted. Click [OK] to refresh attachments.')", true); 
     } 
    } 
    else if (e.CommandName == "Delete") 
    { 
     GridDataItem dataitem = e.Item as GridDataItem; 
     string strPath = dataitem["AttachmentPath"].Text.Trim(); 

     LinkButton lnkAttchName = (LinkButton)dataitem.FindControl("lblAttBy"); 
     string strAttachName = lnkAttchName.Text.Trim(); 
     string strAttchLevel = dataitem["AttachmentLevel"].Text.Trim(); 

     System.IO.FileInfo targetFile = new System.IO.FileInfo(strPath); 
     if (targetFile.Exists) 
      targetFile.Delete(); 
     clsTaskUpdates_BL objBL = new clsTaskUpdates_BL(); 

     gvAtt.DataSource = objBL.delAttachment_Bl(dataitem["oaId"].Text, Session["selorderID"].ToString(), strAttachName, strAttchLevel); 
     gvAtt.DataBind(); 
    } 
} 

protected void gvAtt_ItemDataBound(object sender, GridItemEventArgs e) 
{ 
    try 
    { 
     if (e.Item is GridDataItem) 
     { 
      GridDataItem dataItem = e.Item as GridDataItem; 
      Label lblUser = (Label)dataItem.FindControl("lblCreatedBy"); 
      if (lblUser.Text.ToLower() != Session["UserName"].ToString().ToLower()) 
      { 
       ImageButton imgDel = (ImageButton)dataItem.FindControl("lblDel"); 
       imgDel.Visible = false; 
      } 
     } 
    } 
    catch (Exception ex) 
    { 

    } 
} 

protected void btnSaveAtt_Click(object sender, EventArgs e) 
{ 
    try 
    { 
     lblMsg.Text = string.Empty; 
     if (ddlAttLvl.SelectedItem.Value == "2" && Session["selProjectName"] == null) 
     { 
      //ClientScript.RegisterClientScriptBlock(this.GetType(), "cls1", "<script>ErrMsg()</script>"); 
      lblMsg.Text = "Project Name is NULL, attachments can not be assigned at PROJECT Level. Please use ORDER Level to add attachments"; 
     } 
     else 
     { 
      lblMsg.Text = ""; 
      if (RadUpload1.UploadedFiles.Count > 0) 
      { 
       UploadedFile file = RadUpload1.UploadedFiles[0]; 
       string targetFileName = System.Configuration.ConfigurationManager.AppSettings["AttachmentPath"].ToString() + Session["selorderID"].ToString() + "-" + ddlAttCat.SelectedItem.Value + "-" + DateTime.Now.ToString("MMddyyyyhhmmss") + "-" + file.GetNameWithoutExtension() + file.GetExtension(); 
       file.SaveAs(targetFileName); 
       clsTaskUpdates_BL objBL = new clsTaskUpdates_BL(); 
       gvAtt.DataSource = objBL.setAttachments_Bl(Session["selorderID"].ToString(), ddlAttCat.SelectedItem.Value, file.GetName(), targetFileName, ddlAttLvl.SelectedItem.Text); 
       gvAtt.DataBind(); 
       //ClientScript.RegisterClientScriptBlock(this.GetType(), "cls", "<script>parent.ref()</script>"); 
      } 
      else 
      { 
       lblMsg.Text = "* Please select a file to attach."; 
      } 
     } 
    } 
    catch (Exception ex) 
    { 

    } 
} 

回答

1

EditWinAttachments.aspx有一個變量,它是null其不能爲空。如果您在EditWinAttachments.aspx中顯示了有關您所做的一些詳細信息,則可能更容易明確指出問題所在。

我看到您正在使用Telerik的網格視圖,當您嘗試DataBind()時,確定DataSource不爲空嗎?

+0

這裏是我的示例代碼....如果有任何null,那麼爲什麼它不會拋出一個錯誤...這是我的代碼上面請看看它... – Tronics

+0

當你究竟是否得到錯誤?如果您調試應用程序,您是否可以順利完成每種方法? –