SelectExtensions.EnumDropDownListFor Method

 

Returns an HTML select element for each value in the enumeration that is represented by the specified expression.

Namespace:   System.Web.Mvc.Html
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticEnumDropDownListFor(Of TModel, TEnum)(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.

System_CAPS_pubmethodSystem_CAPS_staticEnumDropDownListFor(Of TModel, TEnum)(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.

System_CAPS_pubmethodSystem_CAPS_staticEnumDropDownListFor(Of TModel, TEnum)(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.

System_CAPS_pubmethodSystem_CAPS_staticEnumDropDownListFor(Of TModel, TEnum)(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.

System_CAPS_pubmethodSystem_CAPS_staticEnumDropDownListFor(Of TModel, TEnum)(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.

System_CAPS_pubmethodSystem_CAPS_staticEnumDropDownListFor(Of TModel, TEnum)(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.

Return to top

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 TModelTEnum))

An expression that identifies the object that contains the values to display.

Return Value

Type: System.Web.Mvc.MvcHtmlString

An 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.

Return to top

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 StringObject)
) 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 TModelTEnum))

An expression that identifies the object that contains the values to display.

htmlAttributes
Type: System.Collections.Generic.IDictionary(Of StringObject)

An object that contains the HTML attributes to set for the element.

Return Value

Type: System.Web.Mvc.MvcHtmlString

An 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.

Return to top

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 TModelTEnum))

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.MvcHtmlString

An 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.

Return to top

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 TModelTEnum))

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.MvcHtmlString

An 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.

Return to top

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 StringObject)
) 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 TModelTEnum))

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 StringObject)

An object that contains the HTML attributes to set for the element.

Return Value

Type: System.Web.Mvc.MvcHtmlString

An 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.

Return to top

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 TModelTEnum))

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.MvcHtmlString

An 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.

Return to top
Show: