Find Control In Datalist
Posted
by KareemSaad
on Stack Overflow
See other posts from Stack Overflow
or by KareemSaad
Published on 2010-04-01T12:20:03Z
Indexed on
2010/04/01
12:23 UTC
Read the original article
Hit count: 298
When I tried To Find Control n data List As I Mentioned Below Error(Object reference not set to an instance of an object. I cannot know
protected void dlCategory_ItemDataBound(object sender, DataListItemEventArgs e)
{
Label Lb = (Label)e.Item.FindControl("LblCat");
Lb.ForeColor = System.Drawing.Color.Red;
}
' onitemcreated="dlSubCategory_ItemCreated" onitemdatabound="dlSubCategory_ItemDataBound"> ' class="buttn_txt"> '>
© Stack Overflow or respective owner