bind a dropdownlist (which outside grid) all values to array using Javascript
After that i want to bind that array values to dropdownlist inside gridview
Bind dropdownlist values to array
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Anubhav ChaudharyRank #29 · 42K reputationPosted Sep 4, 2014, 4:51 AM EDT
for sending the values to array you can use this code:
array=[];
This will send the text of options available in the array whose name is "array", if you want to send the value to array then simply replace $(this).text() with $(this).val().
After this when you want to bind the array values then apply for function on array which will start from "0" to array.length, and add the option in which value from array will be fetched in this manner:
$("#idofDropdown").append(new Option("array[i].text", "array[i].val"));