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 following code trying to set the ItemsList property of my embedded .ascx:
Item item = GetItem(itemID);
myUsercontrol.ItemList = new List<Item>().Add(item);
The property in the .ascx that I'm trying to set looks like this:
public List<Item> ItemsList
{
get { return this.itemsList; }
set { this.itemsList = value; }
}
Error: Cannot implicitly convert type 'void' to 'System.Collections.Generic.List'
So I don't get where it's getting void as part of the property?...weird.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…