i have dropdownlist values added connecting database.
here's code:
<asp:dropdownlist id="dropdownlist1" runat="server" datasourceid="sqldatasource1" datatextfield="devicetype" datavaluefield="devicetype"></asp:dropdownlist> <asp:sqldatasource id="sqldatasource1" runat="server" connectionstring="<%$ connectionstrings:phsnew %>" selectcommand="select distinct [devicetype] [dx_devices]"></asp:sqldatasource>
now want add 1 more option "any" in dropdownlist.
how can add?
this should it:
ddl_myitems.items.insert(0, new listitem("--any--", string.empty)); ddl_myitems.selectedindex = 0;
Comments
Post a Comment