SelectExtensions.EnumDropDownListFor Method
Returns an HTML select element for each value in the enumeration that is represented by the specified expression.
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
SelectExtensions.EnumDropDownListFor(Of TModel, TEnum) Method (HtmlHelper(Of TModel), Expression(Of Func(Of TModel, TEnum)))
Returns an HTML select element for each value in the enumeration that is represented by the specified expression.
<ExtensionAttribute> Public Shared Function EnumDropDownListFor(Of TModel, TEnum) ( htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TEnum)) ) As MvcHtmlString
Parameters
- htmlHelper
-
Type:
System.Web.Mvc.HtmlHelper(Of TModel)
The HTML helper instance that this method extends.
- expression
-
Type:
System.Linq.Expressions.Expression(Of Func(Of TModel, TEnum))
An expression that identifies the object that contains the values to display.
Return Value
Type: System.Web.Mvc.MvcHtmlStringAn HTML select element for each value in the enumeration that is represented by the expression.
Type Parameters
- TModel
The type of the model.
- TEnum
The type of the value.
SelectExtensions.EnumDropDownListFor(Of TModel, TEnum) Method (HtmlHelper(Of TModel), Expression(Of Func(Of TModel, TEnum)), IDictionary(Of String, Object))
Returns an HTML select element for each value in the enumeration that is represented by the specified expression.
<ExtensionAttribute> Public Shared Function EnumDropDownListFor(Of TModel, TEnum) ( htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TEnum)), htmlAttributes As IDictionary(Of String, Object) ) As MvcHtmlString
Parameters
- htmlHelper
-
Type:
System.Web.Mvc.HtmlHelper(Of TModel)
The HTML helper instance that this method extends.
- expression
-
Type:
System.Linq.Expressions.Expression(Of Func(Of TModel, TEnum))
An expression that identifies the object that contains the values to display.
- htmlAttributes
-
Type:
System.Collections.Generic.IDictionary(Of String, Object)
An object that contains the HTML attributes to set for the element.
Return Value
Type: System.Web.Mvc.MvcHtmlStringAn HTML select element for each value in the enumeration that is represented by the expression.
Type Parameters
- TModel
The type of the model.
- TEnum
The type of the value.
SelectExtensions.EnumDropDownListFor(Of TModel, TEnum) Method (HtmlHelper(Of TModel), Expression(Of Func(Of TModel, TEnum)), Object)
Returns an HTML select element for each value in the enumeration that is represented by the specified expression.
<ExtensionAttribute> Public Shared Function EnumDropDownListFor(Of TModel, TEnum) ( htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TEnum)), htmlAttributes As Object ) As MvcHtmlString
Parameters
- htmlHelper
-
Type:
System.Web.Mvc.HtmlHelper(Of TModel)
The HTML helper instance that this method extends.
- expression
-
Type:
System.Linq.Expressions.Expression(Of Func(Of TModel, TEnum))
An expression that identifies the object that contains the values to display.
- htmlAttributes
-
Type:
System.Object
An object that contains the HTML attributes to set for the element.
Return Value
Type: System.Web.Mvc.MvcHtmlStringAn HTML select element for each value in the enumeration that is represented by the expression.
Type Parameters
- TModel
The type of the model.
- TEnum
The type of the value.
SelectExtensions.EnumDropDownListFor(Of TModel, TEnum) Method (HtmlHelper(Of TModel), Expression(Of Func(Of TModel, TEnum)), String)
Returns an HTML select element for each value in the enumeration that is represented by the specified expression.
<ExtensionAttribute> Public Shared Function EnumDropDownListFor(Of TModel, TEnum) ( htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TEnum)), optionLabel As String ) As MvcHtmlString
Parameters
- htmlHelper
-
Type:
System.Web.Mvc.HtmlHelper(Of TModel)
The HTML helper instance that this method extends.
- expression
-
Type:
System.Linq.Expressions.Expression(Of Func(Of TModel, TEnum))
An expression that identifies the object that contains the values to display.
- optionLabel
-
Type:
System.String
The text for a default empty item. This parameter can be null.
Return Value
Type: System.Web.Mvc.MvcHtmlStringAn HTML select element for each value in the enumeration that is represented by the expression.
Type Parameters
- TModel
The type of the model.
- TEnum
The type of the value.
SelectExtensions.EnumDropDownListFor(Of TModel, TEnum) Method (HtmlHelper(Of TModel), Expression(Of Func(Of TModel, TEnum)), String, IDictionary(Of String, Object))
Returns an HTML select element for each value in the enumeration that is represented by the specified expression.
<ExtensionAttribute> Public Shared Function EnumDropDownListFor(Of TModel, TEnum) ( htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TEnum)), optionLabel As String, htmlAttributes As IDictionary(Of String, Object) ) As MvcHtmlString
Parameters
- htmlHelper
-
Type:
System.Web.Mvc.HtmlHelper(Of TModel)
The HTML helper instance that this method extends.
- expression
-
Type:
System.Linq.Expressions.Expression(Of Func(Of TModel, TEnum))
An expression that identifies the object that contains the values to display.
- optionLabel
-
Type:
System.String
The text for a default empty item. This parameter can be null.
- htmlAttributes
-
Type:
System.Collections.Generic.IDictionary(Of String, Object)
An object that contains the HTML attributes to set for the element.
Return Value
Type: System.Web.Mvc.MvcHtmlStringAn HTML select element for each value in the enumeration that is represented by the expression.
Type Parameters
- TModel
The type of the model.
- TEnum
The type of the value.
SelectExtensions.EnumDropDownListFor(Of TModel, TEnum) Method (HtmlHelper(Of TModel), Expression(Of Func(Of TModel, TEnum)), String, Object)
Returns an HTML select element for each value in the enumeration that is represented by the specified expression.
<ExtensionAttribute> Public Shared Function EnumDropDownListFor(Of TModel, TEnum) ( htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TEnum)), optionLabel As String, htmlAttributes As Object ) As MvcHtmlString
Parameters
- htmlHelper
-
Type:
System.Web.Mvc.HtmlHelper(Of TModel)
The HTML helper instance that this method extends.
- expression
-
Type:
System.Linq.Expressions.Expression(Of Func(Of TModel, TEnum))
An expression that identifies the object that contains the values to display.
- optionLabel
-
Type:
System.String
The text for a default empty item. This parameter can be null.
- htmlAttributes
-
Type:
System.Object
An object that contains the HTML attributes to set for the element.
Return Value
Type: System.Web.Mvc.MvcHtmlStringAn HTML select element for each value in the enumeration that is represented by the expression.
Type Parameters
- TModel
The type of the model.
- TEnum
The type of the value.

