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)

Overload List

Name Description
System_CAPS_pubmethodSystem_CAPS_static EnumDropDownListFor<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.

System_CAPS_pubmethodSystem_CAPS_static EnumDropDownListFor<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.

System_CAPS_pubmethodSystem_CAPS_static EnumDropDownListFor<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.

System_CAPS_pubmethodSystem_CAPS_static EnumDropDownListFor<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.

System_CAPS_pubmethodSystem_CAPS_static EnumDropDownListFor<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.

System_CAPS_pubmethodSystem_CAPS_static EnumDropDownListFor<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.

See Also

SelectExtensions Class
System.Web.Mvc.Html Namespace

Return to top

SelectExtensions.EnumDropDownListFor<TModel, TEnum> Method (HtmlHelper<TModel>, Expression<Func<TModel, TEnum>>)

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

Syntax

public static MvcHtmlString EnumDropDownListFor<TModel, TEnum>(
    this HtmlHelper<TModel> htmlHelper,
    Expression<Func<TModel, TEnum>> expression
)
public:
generic<typename TModel, typename TEnum>
[ExtensionAttribute]
static MvcHtmlString^ EnumDropDownListFor(
    HtmlHelper<TModel>^ htmlHelper,
    Expression<Func<TModel, TEnum>^>^ expression
)
static member EnumDropDownListFor<'TModel, 'TEnum> : 
        htmlHelper:HtmlHelper<'TModel> *
        expression:Expression<Func<'TModel, 'TEnum>> -> MvcHtmlString
<ExtensionAttribute>
Public Shared Function EnumDropDownListFor(Of TModel, TEnum) (
    htmlHelper As HtmlHelper(Of TModel),
    expression As Expression(Of Func(Of TModel, TEnum))
) As MvcHtmlString

Parameters

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<TModel, TEnum> Method (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.

Syntax

public static MvcHtmlString EnumDropDownListFor<TModel, TEnum>(
    this HtmlHelper<TModel> htmlHelper,
    Expression<Func<TModel, TEnum>> expression,
    IDictionary<string, object> htmlAttributes
)
public:
generic<typename TModel, typename TEnum>
[ExtensionAttribute]
static MvcHtmlString^ EnumDropDownListFor(
    HtmlHelper<TModel>^ htmlHelper,
    Expression<Func<TModel, TEnum>^>^ expression,
    IDictionary<String^, Object^>^ htmlAttributes
)
static member EnumDropDownListFor<'TModel, 'TEnum> : 
        htmlHelper:HtmlHelper<'TModel> *
        expression:Expression<Func<'TModel, 'TEnum>> *
        htmlAttributes:IDictionary<string, Object> -> MvcHtmlString
<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

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<TModel, TEnum> Method (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.

Syntax

public static MvcHtmlString EnumDropDownListFor<TModel, TEnum>(
    this HtmlHelper<TModel> htmlHelper,
    Expression<Func<TModel, TEnum>> expression,
    object htmlAttributes
)
public:
generic<typename TModel, typename TEnum>
[ExtensionAttribute]
static MvcHtmlString^ EnumDropDownListFor(
    HtmlHelper<TModel>^ htmlHelper,
    Expression<Func<TModel, TEnum>^>^ expression,
    Object^ htmlAttributes
)
static member EnumDropDownListFor<'TModel, 'TEnum> : 
        htmlHelper:HtmlHelper<'TModel> *
        expression:Expression<Func<'TModel, 'TEnum>> *
        htmlAttributes:Object -> MvcHtmlString
<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

  • 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<TModel, TEnum> Method (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.

Syntax

public static MvcHtmlString EnumDropDownListFor<TModel, TEnum>(
    this HtmlHelper<TModel> htmlHelper,
    Expression<Func<TModel, TEnum>> expression,
    string optionLabel
)
public:
generic<typename TModel, typename TEnum>
[ExtensionAttribute]
static MvcHtmlString^ EnumDropDownListFor(
    HtmlHelper<TModel>^ htmlHelper,
    Expression<Func<TModel, TEnum>^>^ expression,
    String^ optionLabel
)
static member EnumDropDownListFor<'TModel, 'TEnum> : 
        htmlHelper:HtmlHelper<'TModel> *
        expression:Expression<Func<'TModel, 'TEnum>> *
        optionLabel:string -> MvcHtmlString
<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

  • 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<TModel, TEnum> Method (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.

Syntax

public static MvcHtmlString EnumDropDownListFor<TModel, TEnum>(
    this HtmlHelper<TModel> htmlHelper,
    Expression<Func<TModel, TEnum>> expression,
    string optionLabel,
    IDictionary<string, object> htmlAttributes
)
public:
generic<typename TModel, typename TEnum>
[ExtensionAttribute]
static MvcHtmlString^ EnumDropDownListFor(
    HtmlHelper<TModel>^ htmlHelper,
    Expression<Func<TModel, TEnum>^>^ expression,
    String^ optionLabel,
    IDictionary<String^, Object^>^ htmlAttributes
)
static member EnumDropDownListFor<'TModel, 'TEnum> : 
        htmlHelper:HtmlHelper<'TModel> *
        expression:Expression<Func<'TModel, 'TEnum>> *
        optionLabel:string *
        htmlAttributes:IDictionary<string, Object> -> MvcHtmlString
<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

  • 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<TModel, TEnum> Method (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.

Syntax

public static MvcHtmlString EnumDropDownListFor<TModel, TEnum>(
    this HtmlHelper<TModel> htmlHelper,
    Expression<Func<TModel, TEnum>> expression,
    string optionLabel,
    object htmlAttributes
)
public:
generic<typename TModel, typename TEnum>
[ExtensionAttribute]
static MvcHtmlString^ EnumDropDownListFor(
    HtmlHelper<TModel>^ htmlHelper,
    Expression<Func<TModel, TEnum>^>^ expression,
    String^ optionLabel,
    Object^ htmlAttributes
)
static member EnumDropDownListFor<'TModel, 'TEnum> : 
        htmlHelper:HtmlHelper<'TModel> *
        expression:Expression<Func<'TModel, 'TEnum>> *
        optionLabel:string *
        htmlAttributes:Object -> MvcHtmlString
<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

  • 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