For that you have to use
jQuery.
Sample one is as below:
<script type="text/javascript">
Sys.require('jQuery', function () {
var ownerKey = ui.draggable.data('owner-key');
var providerKey = '<%: Model.Provider.Key %>';
$.ajax({
url: "/Portal/GetPurchasedPackages",
dataType: 'json',
data: { ownerKey: ownerKey, providerKey: providerKey },
success: function (data) {
$("#purchasedPackages").fillSelect(data);
$("#purchasedPackages").sb("refresh");
}
});
$.fn.fillSelect = function (data) {
return this.clearSelect().each(function () {
if (this.tagName == 'SELECT') {
var dropdownList = this;
$.each(data, function (index, optionData) {
var option = new Option(optionData.Text, optionData.Value);
if ($.browser.msie) {
dropdownList.add(option);
} else {
dropdownList.add(option, null);
}
});
}
});
};
$.fn.clearSelect = function () {
return this.each(function () {
if (this.tagName == 'SELECT')
this.options.length = 0;
});
};
</script>
});
For more info :
How to populate ASP.NET DropDownList using jQuery and Ajax
http://jquerybyexample.blogspot.com/2012/04/how-to-populate-aspnet-dropdownlist.html[
^]
I hope this will help to you.