Populate HTML DropDownList using jQuery AJAX and JSON in C# and VB.Net

Last Reply on Nov 18, 2016 01:46 AM By dharmendr

Posted on Nov 18, 2016 01:42 AM

Hai all, I have problem with database connection with html dropdownlist. We know how to connect database with asp:dropdownlist.

<asp:DropDownList ID="dropdownlist1" runat="server" AppendDataBoundItems="true" DataSourceID="SqlDataSource1" DataTextField="DTF" DataValueField="DVF">
   <asp:ListItem Value="0"><--Select--></asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Connection %>" SelectCommand="Select Statement">
</asp:SqlDataSource>

its working good.

my problem is

<select id = "dropdownlist1" name="dropdownlist1" >
     <option value="0"><--Select--></option>               
</select>	

how to database connection with above html dropdownlist..

please help me.

Posted on Nov 18, 2016 01:46 AM

Hi nagaraju60,

This is html controls. So for that you have to make ajax call. For this refer the below article.

Populate (Bind) ASP.Net DropDownList using jQuery AJAX and JSON in C# and VB.Net