I am trying to set a property of my .ascx controls from an .aspx using that control.
So in one of my .aspx which has this control in it, I have the
You can't do that because the Add function returns void, not a reference to the list. You can do this:
mycontrol.ItemList = new List(); mycontrol.ItemList.Add(item);
or use a collection initializer:
mycontrol.ItemList = new List { item };