You can follow the below mentioned example and adjust it according to your situation.
View
<select id="purchasedPackages" name="purchasedPackages">
</select>
JavaScript
<script type="text/javascript">
Sys.require('jQuery', function () {
$.ajax({
url: "/Portal/GetPurchasedPackages",
dataType: 'json',
data: { },
success: function (data) {
$("#purchasedPackages").fillSelect(data);
}
});
$.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>
});
I hope this will help to you.