Well, I feel like I'm missing something really simple here. I have an ASP.NET DropDownList control:
<asp:DropDownList ID="rightColumnDropDownList" runat="server"></asp:DropDownList>
In the code behind me (simplified, but still have a problem):
protected override void OnPreRender(EventArgs e) { ListItemCollection options = new ListItemCollection(); options.Add(new ListItem("name", "value")); this.rightColumnDropDownList.DataSource = options; this.rightColumnDropDownList.DataBind(); }
However, the resulting HTML code has parameters that contain a "name" for both the value and the text of the option element.
<option value="name">name</option>
What am I missing here? I also tried this to no avail:
options.Add(new ListItem(){ Text= "name", Value = "value"});
6of58 source share