Panel with in Listview gives me an error(Object reference not set to an instance of an object.)
I have a panel in Itewmtemplate of list view it's only supposed to show when user is logged in, by default the visibility = false. Help is appreciated.
My problem was I was trying to acces it wrongly through a function I created when I was supposed to use the Item_Created Event here is the final working code:
Code:
protected void ListView1_ItemCreated(object sender, ListViewItemEventArgs e)
{
Control control = e.Item.FindControl("pnlOptions");
Panel pnlOptions = control as Panel;
pnlOptions.Visible = true;
}
Last edited by digioz; 06-25-10 at 08:22 AM.
Reason: Code Tags