126 how to bind dropdownlist in asp net using jquery or JSON

Video ready, click here to close ×

126.In previous articles I explained Bind gridview using JQuery in asp.net and AutoComplete textbox with JQuery using asp.net. Now I will explain how to bind dropdownlist using JQuery or JSON in asp.net.
To implement this concept first design table in database and give name as Country as shown below
Column Name
Data Type
Allow Nulls
int(set identity property=true)
After completion table design enter some of Country details in database to work for our sample and write the following code in your aspx page

Function :
$(document).ready(function() {
type: “POST”,
contentType: “application/json; charset=utf-8”,
url: “Default.aspx/BindDatatoDropdown”,
data: “{}”,
dataType: “json”,
success: function(data) {
$.each(data.d, function(key, value) {
error: function(result) {
}); Follow Us On
Facebook : www.facebook.com/yoctokarthi
Twitter : www.twitter.com/yoctokarthi
Google Plus : https://plus.google.com/+YoctoKarthi
HackerRank : www.hackerrank.com/yoctokarthi
Instagram : www.instagram.com/yoctokarthi


Leave a Reply

Your email address will not be published. Required fields are marked *