Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

SelectExtensions Class

Represents support for making selections in a list.

System.Object
  System.Web.Mvc.Html.SelectExtensions

Namespace:  System.Web.Mvc.Html
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)
public static class SelectExtensions
  NameDescription
Public methodStatic memberDropDownList(HtmlHelper, String)Returns a single-selection select element using the specified HTML helper and the name of the form field.
Public methodStatic memberDropDownList(HtmlHelper, String, IEnumerable<SelectListItem>)Returns a single-selection select element using the specified HTML helper, the name of the form field, and the specified list items.
Public methodStatic memberDropDownList(HtmlHelper, String, String)Returns a single-selection select element using the specified HTML helper, the name of the form field, and an option label.
Public methodStatic memberDropDownList(HtmlHelper, String, IEnumerable<SelectListItem>, IDictionary<String, Object>)Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HTML attributes.
Public methodStatic memberDropDownList(HtmlHelper, String, IEnumerable<SelectListItem>, Object)Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HTML attributes.
Public methodStatic memberDropDownList(HtmlHelper, String, IEnumerable<SelectListItem>, String)Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and an option label.
Public methodStatic memberDropDownList(HtmlHelper, String, IEnumerable<SelectListItem>, String, IDictionary<String, Object>)Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, an option label, and the specified HTML attributes.
Public methodStatic memberDropDownList(HtmlHelper, String, IEnumerable<SelectListItem>, String, Object)Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, an option label, and the specified HTML attributes.
Public methodStatic memberDropDownListFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, IEnumerable<SelectListItem>)Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items.
Public methodStatic memberDropDownListFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, IEnumerable<SelectListItem>, IDictionary<String, Object>)Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes.
Public methodStatic memberDropDownListFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, IEnumerable<SelectListItem>, Object)Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes.
Public methodStatic memberDropDownListFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, IEnumerable<SelectListItem>, String)Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and option label.
Public methodStatic memberDropDownListFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, IEnumerable<SelectListItem>, String, IDictionary<String, Object>)Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items, option label, and HTML attributes.
Public methodStatic memberDropDownListFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, IEnumerable<SelectListItem>, String, Object)Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items, option label, and HTML attributes.
Public methodStatic memberEnumDropDownListFor<TModel, TEnum>(HtmlHelper<TModel>, Expression<Func<TModel, TEnum>>)Returns an HTML select element for each value in the enumeration that is represented by the specified expression.
Public methodStatic memberEnumDropDownListFor<TModel, TEnum>(HtmlHelper<TModel>, Expression<Func<TModel, TEnum>>, IDictionary<String, Object>)Returns an HTML select element for each value in the enumeration that is represented by the specified expression.
Public methodStatic memberEnumDropDownListFor<TModel, TEnum>(HtmlHelper<TModel>, Expression<Func<TModel, TEnum>>, Object)Returns an HTML select element for each value in the enumeration that is represented by the specified expression.
Public methodStatic memberEnumDropDownListFor<TModel, TEnum>(HtmlHelper<TModel>, Expression<Func<TModel, TEnum>>, String)Returns an HTML select element for each value in the enumeration that is represented by the specified expression.
Public methodStatic memberEnumDropDownListFor<TModel, TEnum>(HtmlHelper<TModel>, Expression<Func<TModel, TEnum>>, String, IDictionary<String, Object>)Returns an HTML select element for each value in the enumeration that is represented by the specified expression.
Public methodStatic memberEnumDropDownListFor<TModel, TEnum>(HtmlHelper<TModel>, Expression<Func<TModel, TEnum>>, String, Object)Returns an HTML select element for each value in the enumeration that is represented by the specified expression.
Public methodStatic memberListBox(HtmlHelper, String)Returns a multi-select select element using the specified HTML helper and the name of the form field.
Public methodStatic memberListBox(HtmlHelper, String, IEnumerable<SelectListItem>)Returns a multi-select select element using the specified HTML helper, the name of the form field, and the specified list items.
Public methodStatic memberListBox(HtmlHelper, String, IEnumerable<SelectListItem>, IDictionary<String, Object>)Returns a multi-select select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HMTL attributes.
Public methodStatic memberListBox(HtmlHelper, String, IEnumerable<SelectListItem>, Object)Returns a multi-select select element using the specified HTML helper, the name of the form field, and the specified list items.
Public methodStatic memberListBoxFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, IEnumerable<SelectListItem>)Returns an HTML select element for each property in the object that is represented by the specified expression and using the specified list items.
Public methodStatic memberListBoxFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, IEnumerable<SelectListItem>, IDictionary<String, Object>)Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes.
Public methodStatic memberListBoxFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, IEnumerable<SelectListItem>, Object)Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes.
Top

The SelectExtensions class contains methods that extend the HtmlHelper class. Each extension method renders an HTML select element. The DropDownList method renders an element that enables the user to select an item from a drop-down list. The ListBox method renders an element that enables the user to select from a scrolling list of items.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.