drop down menu - data binding to dropdownlist in asp.net? -
for label in bind data using
<asp:label id="label2" runat="server" text='<%#eval("address") %>'></asp:label>
how bind data dropdownlist that?
asp:dropdownlist id="droplist" runat="server" > <asp:listitem text="admin"></asp:listitem> <asp:listitem text="manager"></asp:listitem> </asp:dropdownlist>
like this....
<asp:dropdownlist id="droplist" runat="server" selectedvalue='<%#eval("fieldname")%>'> <asp:listitem text="admin"></asp:listitem> <asp:listitem text="manager"></asp:listitem> </asp:dropdownlist>
note intellisense not pick selectedvalue out. of course need populate dropdown data... using method suits
Comments
Post a Comment