I am simply trying to set a label in the OnItemDataBound event handler for my datalist. This is my code:<BR><BR>&#060;asp:datalist OnItemDataBound="FormatItems" ...etc...&#062;<BR><BR>-----<BR>public System.Web.UI.WebControls.Label AFDC;<BR><BR>protected void FormatItems(object Sender, DataListItemEventArgs e)<BR> { <BR> if (e.Item.ItemType == ListItemType.Item &#124&#124 <BR> e.Item.ItemType == ListItemType.AlternatingItem)<BR> { <BR> object di = e.Item.DataItem; <BR> object val = DataBinder.Eval(di, "ABG"); <BR> <BR> Response.Write(val); <BR> Response.Write("<BR>"); <BR> <BR> AFDC.Text="hello";<BR> <BR> <BR> }<BR> }<BR><BR>I get this error at the AFDC.Text="hello" part: Object reference not set to an instance of an object. <BR><BR>This only happens when i put it in this particular event handler if i put it anywhere else it works fine, however i of course need it in this particular event handler because i am trying to turn it red. <BR><BR>