Table of Contents

Class SelectListItem

Namespace
System.Web.Mvc
Assembly
System.Web.Mvc.dll

Represents the selected item in an instance of the SelectList class.

public class SelectListItem
Inheritance
SelectListItem
Inherited Members

Constructors

SelectListItem()

Initializes a new instance of the SelectListItem class.

public SelectListItem()

Properties

Disabled

Gets or sets a value that indicates whether this SelectListItem is disabled.

public bool Disabled { get; set; }

Property Value

bool

Group

Represents the optgroup HTML element this item is wrapped into. In a select list, multiple groups with the same name are supported. They are compared with reference equality.

public SelectListGroup Group { get; set; }

Property Value

SelectListGroup

Selected

Gets or sets a value that indicates whether this SelectListItem is selected.

public bool Selected { get; set; }

Property Value

bool

true if the item is selected; otherwise, false.

Text

Gets or sets the text of the selected item.

public string Text { get; set; }

Property Value

string

The text.

Value

Gets or sets the value of the selected item.

public string Value { get; set; }

Property Value

string

The value.