Server Eventlog warnings
HI,
I am getting below warning messages. I dono why? But in my local its working great. No warnings in my machine eventlogs. Can anyone help me??? Here is my eventlog warnings..
Log Name: Application Source: ASP.NET 2.0.50727.0 Date:
2/11/2011 9:54:46 AM Event ID:
1309 Task Category: Web Event Level: Warning Keywords: Classic User: N/A Computer: PACDCPCCOMA01.cable.comcast.com Description: Event code: 3005 Event message: An unhandled exception has occurred. Event time: 2/11/2011 9:54:46 AM Event time (UTC): 2/11/2011 2:54:46 PM Event ID: b60b4cc9c1c941a59414965489a83629 Event sequence: 79355 Event occurrence: 1 Event detail code: 0 Application information: Application domain: /LM/W3SVC/1/ROOT-1-129418968817826366 Trust level: Full Application Virtual Path: / Application Path: C:\inetpub\wwwroot\OM\ Machine name: PACDCPCCOMA01 Process information: Process ID: 3912 Process name: w3wp.exe Account name: IIS APPPOOL\Classic .NET AppPool Exception information:Exception type: NullReferenceException Exception message: Object reference not set to an instance of an
object. Request information: Request 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
information: Thread ID: 4 Thread account name: IIS APPPOOL\Classic .NET AppPool Is impersonating: False Stack trace: at EditWinAttachments.gvAtt_ItemDataBound(Object sender, GridItemEventArgs e) in C:\Documents and Settings\bpucha1103c\Desktop\Latest code\CCOM_PROD\CellBackHaul\EditWinAttachments.aspx.cs:line 113 at Telerik.Web.UI.RadGrid.OnItemDataBound(GridItemEventArgs e) at Telerik.Web.UI.GridItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) at Telerik.Web.UI.GridItemBuilder.InitializeItem(Int32 dataSourceIndex, String& nextItemHierarchicalIndex, Boolean& itemIsInEditMode) at Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group) at Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls) at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource)
at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at Telerik.Web.UI.GridTableView.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at Telerik.Web.UI.GridTableView.DataBind() at Telerik.Web.UI.RadGrid.DataBind() at EditWinAttachments.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\bpucha1103c\Desktop\Latest code\CCOM_PROD\CellBackHaul\EditWinAttachments.aspx.cs:line 39 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) Custom event details:Event Xml: 1309 3 3 0x80000000000000 9041 Application PACDCPCCOMA01.cable.comcast.com 3005 An unhandled exception has occurred. 2/11/2011 9:54:46 AM 2/11/2011 2:54:46 PM b60b4cc9c1c941a59414965489a83629 79355 1 0 /LM/W3SVC/1/ROOT-1-129418968817826366 Full / C:\inetpub\wwwroot\OM\ PACDCPCCOMA01 3912 w3wp.exe IIS APPPOOL\Classic .NET AppPool NullReferenceException Object reference not set to an instance of an object. http://ccom/EditWinAttachments.aspx?id=1 /EditWinAttachments.aspx 10.163.26.31 CABLE\HAlmei001 True Negotiate IIS APPPOOL\Classic .NET AppPool 4 IIS APPPOOL\Classic .NET AppPool False at EditWinAttachments.gvAtt_ItemDataBound(Object sender, GridItemEventArgs e) in C:\Documents and Settings\bpucha1103c\Desktop\Latest code\CCOM_PROD\CellBackHaul\EditWinAttachments.aspx.cs:line 113 at Telerik.Web.UI.RadGrid.OnItemDataBound(GridItemEventArgs e) at Telerik.Web.UI.GridItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) at Telerik.Web.UI.GridItemBuilder.InitializeItem(Int32 dataSourceIndex, String& nextItemHierarchicalIndex, Boolean& itemIsInEditMode) at Telerik.Web.UI.GridItemBuilder.Cr开发者_运维百科eateItems(GridGroupingContext group) at Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls) at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource)
at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at Telerik.Web.UI.GridTableView.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at Telerik.Web.UI.GridTableView.DataBind() at Telerik.Web.UI.RadGrid.DataBind() at EditWinAttachments.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\bpucha1103c\Desktop\Latest code\CCOM_PROD\CellBackHaul\EditWinAttachments.aspx.cs:line 39 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean 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)
{
}
}
In EditWinAttachments.aspx
there is a variable that is null
which should not be null. If you show some details about what you do in EditWinAttachments.aspx
it might be easier to point down exactly on what the problem is.
I see that you are using a Grid View from Telerik, are you sure that the DataSource
is not null when you try to DataBind()
?
精彩评论