Women in Technology

Hear us Roar



Article:
  ASP.NET Data Controls Part 3: DataList
Subject:   Object reference not set to an instance of an object.
Date:   2007-07-31 22:47:36
From:   mycomments
i am having problem with the "Object reference not set to an instance of an object"
i get this error when press the "update"


tbox = CType(e.Item.FindControl("name"), TextBox);
-----> this line


NullReferenceException: Object reference not set to an instance of an object.]
ataasia.editdetail.DataList2_UpdateCommand(Object source, DataListCommandEventArgs e) in c:\inetpub\wwwroot\ataasia\editdetail.aspx.cs:85
System.Web.UI.WebControls.DataList.OnUpdateCommand(DataListCommandEventArgs e)
System.Web.UI.WebControls.DataList.OnBubbleEvent(Object source, EventArgs e)
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
System.Web.UI.WebControls.DataListItem.OnBubbleEvent(Object source, EventArgs e)
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()