Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
EnumHelper Class

EnumHelper Class

 

Provides methods for working with enumeration values and select lists.

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

System.Object
  System.Web.Mvc.Html.EnumHelper

public static class EnumHelper

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticGetSelectList(ModelMetadata)

Gets a list of SelectListItem objects corresponding to enum constants defined in the given metadata.

System_CAPS_pubmethodSystem_CAPS_staticGetSelectList(ModelMetadata, Enum)

Gets a list of SelectListItem objects corresponding to enum constants defined in the given metadata. Also ensures the value will round-trip even if it does not match a defined constant and sets the Selected property to true for one element in the returned list -- matching the value.

System_CAPS_pubmethodSystem_CAPS_staticGetSelectList(Type)

Gets a list of SelectListItem objects corresponding to enum constants defined in the given type.

System_CAPS_pubmethodSystem_CAPS_staticGetSelectList(Type, Enum)

Gets a list of SelectListItem objects corresponding to enum constants defined in the given type. Also ensures the value will round-trip even if it does not match a defined constant and sets the Selected property to true for one element in the returned list -- matching the value.

System_CAPS_pubmethodSystem_CAPS_staticIsValidForEnumHelper(ModelMetadata)

Gets a value indicating whether the given metadata or associated expression is suitable for use in GetSelectList and EnumDropDownListFor<TModel, TEnum> calls.

System_CAPS_pubmethodSystem_CAPS_staticIsValidForEnumHelper(Type)

Gets a value indicating whether the given type or an expression of this type is suitable for use in GetSelectList and EnumDropDownListFor<TModel, TEnum> calls.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2015 Microsoft