Add System.Web.UI.WebControls.ListItemCollection

.Add()

Adds a text and value to a System.Web.UI.WebControls.ListItemCollection as a new ListItem.

Method

public static void Add(this System.Web.UI.WebControls.ListItemCollection items, string text, string value)
string text

The text value of the new list item.

string value

The value field of the new list item.

Example

C#
var items = new System.Web.UI.WebControls.ListItemCollection();
item.Add("My Text", "MyValue");