Hi guys
Simple problem...i use the following code to create a ListItem collection with Name/Value pairs:
private ListItemCollection loadServices() { ListItemCollection colServices=new ListItemCollection(); colServices.Add(new ListItem("Not Specified", "-1")); colServices.Add(new ListItem("Terminal Services", "TS")); colServices.Add(new ListItem("FTP Server", "FTP")); return colServices; }
I then assign it as the data for a dropdown list:
ListItemCollection lstServices = new ListItemCollection(); lstServices=loadServices(); if (lstServices != null) { cmbService.DataSource = lstServices; cmbService.DataBind(); }
However, the 'Value' property is ignored and just replaced with a copy of 'Text' property - i have checked the lstServices collection and it is as expected.
Am i missing something?