I have one dropdownlist,it contains 3 items like open invoices,close invoices and all invoices.when select any one it should into array or arraylist.like if i select index 1 means it should save,then i select index 2 means it should save ,我再次选择索引 1 意味着它应该保存到单独的 arrat 索引中,而不是替换。是否可以用于数组、foreach 或 arraylist。我尝试使用 arraylist
if (ddlTransaction.SelectedIndex < 3)
{
list.Add(ddlTransaction.SelectedItem);
}
但它只保存当前选择的下拉项保存。