About DropDownList Question !!

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hi there,

I can use the method DropDownList1.Items.Add("test") to add data to the
dropdownlist control.
But how should I do if I want to insert the control property TEXT is "test"
and the VALUE is "1".
Thanks !!
 
Paul said:
Hi there,

I can use the method DropDownList1.Items.Add("test") to add data to the
dropdownlist control.
But how should I do if I want to insert the control property TEXT is "test"
and the VALUE is "1".
Thanks !!

Use the other Add method:

DropDownList1.Items.Add(new ListItem("text", "value"));

Arild
 
Back
Top