View Full Version : How To Get Dynamic DropDown List Control in asp.net
jayasree
12-16-2009, 10:37 AM
Hi friends,
I had an doubt on dropdownlist control in asp.net to enter one value to that dropdownlist and that value is added to that dropdownlist..
how it is possible..
Mike_O
12-17-2009, 05:09 PM
Hey jayasree,
This link sums it up: http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/standard/dropdownlist.aspx
You do not necessarily need to bind an ArrayList to the DropdownList, as it is shown in Example#2. You can also say something like this..
DropDown1.Items.Add(new ListItem("Hello"));
Regards,
Mike
wren11
01-03-2010, 12:51 AM
string[] Items = new string[] { "1", "2", "3", "4", "5" };
foreach (var str in Items)
DropDownList1.Items.Add(str);
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.