Author: tugberk_ugurlu_ | Posted on: 12/31/2009 6:59:48 PM | Views : 511

Hi there ! I have Two dropdowns in my project and both of them is get their datas from a datasource first one is like that;
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="AccessDataSource2" DataTextField="Location" DataValueField="Location" AutoPostBack="True" ValidationGroup="5" AppendDataBoundItems="True"> <asp:ListItem Selected="True" Value="-1">---Seçim Yapiniz---</asp:ListItem> </asp:DropDownList> <asp:AccessDataSource ID="AccessDataSource2" runat="server" DataFile="~/App_Data/Hotels.mdb" SelectCommand="SELECT distinct [Location] FROM [Hotels] ORDER BY [Location]"> </asp:AccessDataSource>
As you can see, it includes a listItem as well as datasource and it works smoot ...

Go to the complete details ...