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
The Add method doesn't return a reference to the list. You have to do this in two steps:
ItemListt.ItemList = new List- ();
ItemListt.ItemList.Add(item);
Alternatively use a local variable to hold the reference before you put it in the property:
List- list = new List
- ();
list.Add(item);
ItemListt.ItemList = list;