In this article I will show you to add DropDownList dynamically in your ASP.NET Application. I am using jQuery script to do this. This article will help you to whenever you want to add the dropdownlist at run time. You need not to add the dropdownlist control on the Page.
Free Download
Dynamic DropDownList : Demo Project
jQuery Code to add DropDownList:
<head runat="server"> <script src="http://code.jquery.com/jquery-latest.min.js"> </script> <script type="text/javascript"> $(document).ready(function () { var data = { 'Country': 'India', 'Country1': 'USA', 'Country2': 'UK',
'Country3': 'Rusia', 'Country4': 'France' }; var s = $('<select />'); for (var val in data) {
$('<option />', { value: val, text: data[val] }).appendTo(s); } s.appendTo('body'); }); </script> </head>