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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -