DataList child control question

lucky_luck668

New Member
I am creating a DataList, and in the edit item template I would like to have a section that is visible only if the user of the site is logged in as an administrator. Basically, it's a sub table inside the table which makes up the template. I have set the table to 'runat=server' and given it an ID name. What I have tried to do is this: 1) first if have tried to access it through the event item, however this doesn't work which makes sense in that the eventargs are being posted from the item template; 2) I have tried to access it using object drill down (Datalist.edititemtemplate.control.visibity = true) which doesn't seem to work either. In both circumstances I get an exception that tells me essentially that the control has not been instanciated and cannot be programed against. I understand why this would be true in the first case becasue I am changing templates for the item selected to edit. I can even understand which it doesn't exist in the second case becasue the information ... including the EditItemIndex has not been bound. So what I'm really looking for is a way I can programatically set the visiblity of the child con'trol in the template before it's bound to.
 
Back
Top