SelectExtensions.DropDownList Method

Returns a select element that lets users select one item.

  NameDescription
Public method Static member DropDownList(HtmlHelper, String) Returns a select element that lets users select one item, by using the specified HTML helper and the name of the form field.
Public method Static member DropDownList(HtmlHelper, String, IEnumerable<SelectListItem>) Returns a select element that lets users select one item, by using the specified HTML helper, the name of the form field, and the specified list items.
Public method Static member DropDownList(HtmlHelper, String, String) Returns a select element that lets users select one item, by using the specified HTML helper, the name of the form field, and an option label.
Public method Static member DropDownList(HtmlHelper, String, IEnumerable<SelectListItem>, IDictionary<String, Object>) Returns a select element that lets users select one item, by using the specified HTML helper, the name of the form field, the specified list items, and the specified HTML attributes.
Public method Static member DropDownList(HtmlHelper, String, IEnumerable<SelectListItem>, Object) Returns a select element that lets users select one item, by using the specified HTML helper, the name of the form field, the specified list items, and the specified HTML attributes.
Public method Static member DropDownList(HtmlHelper, String, IEnumerable<SelectListItem>, String) Returns a select element that lets users select one item, by using the specified HTML helper, the name of the form field, the specified list items, and an option label.
Public method Static member DropDownList(HtmlHelper, String, IEnumerable<SelectListItem>, String, IDictionary<String, Object>) Returns a select element that lets users select one item, by using the specified HTML helper, the name of the form field, the specified list items, an option label, and the specified HTML attributes.
Public method Static member DropDownList(HtmlHelper, String, IEnumerable<SelectListItem>, String, Object) Returns a select element that lets users select one item, by using the specified HTML helper, the name of the form field, the specified list items, an option label, and the specified HTML attributes.
Top

The DropDownList method renders an element that enables the user to select an item from a drop-down list. Each item in the list is a SelectListItem instance.

Community Additions

Show: