Export (0) Print
Expand All

SelectList Class

.NET Framework 4

Represents a list that lets users select one item.

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

public class SelectList : MultiSelectList

The SelectList type exposes the following members.

  NameDescription
Public methodSelectList(IEnumerable)Initializes a new instance of the SelectList class by using the specified items for the list.
Public methodSelectList(IEnumerable, Object)Initializes a new instance of the SelectList class by using the specified items for the list and a selected value.
Public methodSelectList(IEnumerable, String, String)Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, and the data text field.
Public methodSelectList(IEnumerable, String, String, Object)Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, and a selected value.
Top

  NameDescription
Public propertyDataTextFieldGets or sets the data text field. (Inherited from MultiSelectList.)
Public propertyDataValueFieldGets or sets the data value field. (Inherited from MultiSelectList.)
Public propertyItemsGets or sets the items in the list. (Inherited from MultiSelectList.)
Public propertySelectedValueGets the list value that was selected by the user.
Public propertySelectedValuesGets or sets the selected values. (Inherited from MultiSelectList.)
Top

  NameDescription
Public methodEqualsDetermines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetEnumeratorReturns an enumerator that can be used to iterate through the collection. (Inherited from MultiSelectList.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Explicit interface implemetationPrivate methodIEnumerable.GetEnumeratorReturns an enumerator can be used to iterate through a collection. (Inherited from MultiSelectList.)
Top

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

Community Additions

ADD
Show:
© 2014 Microsoft