Share via


SelectListItem Class

Represents an item in an HTML select list.

Inheritance Hierarchy

System.Object
  System.Web.WebPages.Html.SelectListItem

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

Syntax

'Declaration
Public Class SelectListItem
'Usage
Dim instance As SelectListItem
public class SelectListItem
public ref class SelectListItem
type SelectListItem =  class end
public class SelectListItem

The SelectListItem type exposes the following members.

Constructors

  Name Description
Public method SelectListItem() Initializes a new instance of the SelectListItem class using the default settings.
Public method SelectListItem(SelectListItem) Initializes a new instance of the SelectListItem class by copying the specified select list item.

Top

Properties

  Name Description
Public property Selected Gets or sets a value that indicates whether the SelectListItem instance is selected.
Public property Text Gets or sets the text that is used to display the SelectListItem instance on a web page.
Public property Value Gets or sets the value of the HTML value attribute of the HTML option element that is associated with the SelectListItem instance.

Top

Methods

  Name Description
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Public method ToString (Inherited from Object.)

Top

Remarks

The SelectListItem class represents a single HTML option element inside an HTML select list (an HTML select element) on a web page.

Thread Safety

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

See Also

Reference

System.Web.WebPages.Html Namespace