J
James
Hi,
I have a ListItemCollection which contains data like below:
System.Web.UI.WebControls.ListItemCollection licListItems = new
System.Web.UI.WebControls.ListItemCollection ();
licListItems.Add (new ListItem ("One", "1"));
licListItems.Add (new ListItem ("Two", "2"));
licListItems.Add (new ListItem ("Three", "3"));
return licListItems;
But when I bind this ListItemCollection into a DropDownList,
the DropDownList generated HTML code like below:
<select>
<option value="One">One
<option value="Two">Two
<option value="Three">Three
</select>
Instead of
<select>
<option value="1">One
<option value="2">Two
<option value="3">Three
</select>
Can anybody help?
Thanks & Regards,
James
I have a ListItemCollection which contains data like below:
System.Web.UI.WebControls.ListItemCollection licListItems = new
System.Web.UI.WebControls.ListItemCollection ();
licListItems.Add (new ListItem ("One", "1"));
licListItems.Add (new ListItem ("Two", "2"));
licListItems.Add (new ListItem ("Three", "3"));
return licListItems;
But when I bind this ListItemCollection into a DropDownList,
the DropDownList generated HTML code like below:
<select>
<option value="One">One
<option value="Two">Two
<option value="Three">Three
</select>
Instead of
<select>
<option value="1">One
<option value="2">Two
<option value="3">Three
</select>
Can anybody help?
Thanks & Regards,
James