add items to dropdownlist html
In this line we are using the HTML Helper DropDownListFor method to create a dropdownlist, in other words HTML select element. We are using the property SubjectList that contains all list items of subjects that bind to it. It generates the following HTML code. 1. It allows you to add the specified list item at the end of DropDownList’s Item collection. You can use the well suited overloaded method of ListItem class constructor to add a new item. 2. It appends the collection of list items of DropDownList control by adding the specified string at the end of items collection. the following example code demonstrate us how can we add list item programmatically at run time using c# script section. dropdownlist Items property get the collection of items in the dropdownlist. we can add a ListItem to this items collection using its Add method (ListItemCollection.Add method). Following are the two overloaded ways for using the Add method of Items collection property of DropDownList: 1. It allows you to add the specified list item at the end of DropDownList’s Item collection. You can use the well suited overloaded method of ListItem class constructor to add a new item. 2. dropdownlist is an asp.net list web server control that allow users to select a single item at a time. developers can add list items to dropdownlist control at design time or programmatically at run time or data bind with a data source control. You can use the well suited overloaded method of ListItem class constructor to add a new item. 2. It appends the collection of list items of DropDownList control by adding the specified string at the end of items collection. The DropDownList helper used to create an HTML select list requires a, either explicitly or implicitly. That is, you can pass the explicitly to the DropDownList helper or you can add the to the ViewBag using the same name for the SelectListItem as the model property. The information in this topic applies to all list Web server controls: ListBox, DropDownList, CheckBoxList, RadioButtonList, and BulletedList. You can add items to a list Web server control in these ways: Add static items at design time. Add items programmatically at run time. Get the output for above discussed code from the following link: Populate DropDownList Items Dynamically. Continue to the next tutorial: Setting ASP.Net Dropdownlist Default Value to learn how to select a list item to display it as default value of dropdownlist control. Add items using data binding. For details, see How to: Populate List Web Server Controls from a Data Source. You can add items from a data source to static items you create at design time. When you add a list item, you specify up to three possible properties of the item, as described in the following table.
 DropDownList’s Item collection. You can use the well suited overloaded method of ListItem class constructor to add a new item.