I\'m trying to add an array of controls to an aspx page (C# code behind). These are the similar controls (search criteria for separate fields but will have the same values)
You can give them valid IDs and put them all in an array yourself:
protected void Page_Load(object sender, EventArgs e) {
ListItem[] items = new ListItem[3];
...
DropDownList[] lists = new DropDownList[] { FruitDropDown0
,FruitDropDown1
,...};
foreach(DropDownList list in lists) {
list.Items.AddRange(items);
list.DataBind();
}
}