This one is probably really simple and I am missing something, I am creating an app dev model for SharePoint online and I currently have a ASP.NET DropDownList that I want to populate with items from within SharePoint.

I have got a list called "currency" within the host web and I have managed to retrieve all of these list items using some JavaScript, I now want to put these list items inside of the ASP.NET dropdown but I cant seem to get it wowrking.

I so far have the following code:

.net dropdown:

<asp:DropDownList ID="currencyDropDown" runat="server" ></asp:DropDownList>


function successHandler() {
        var listItemInfo = '';
        var listItemEnumerator = collListItem.getEnumerator();
        while (listItemEnumerator.moveNext()) {
            var oListItem = listItemEnumerator.get_current();


I have tried a few different solutions to set the dropdown but so far none of them appear to have worked.

I would greatly appreciate any help that I can be given with this issue.

1 Answer 1


You need to create the HTML

 <option value="volvo">Volvo</option>
 <option value="saab">Saab</option>
 <option value="mercedes">Mercedes</option>
 <option value="audi">Audi</option>

So you have to append the OPTION DOM elements

  • +1 for putting the "Swedish" brands first ;) Commented Aug 4, 2015 at 15:58
  • Singular... Saab Automobile was aquired by Spyker (dutch) and then sold to the chinese Commented Aug 4, 2015 at 16:12
  • And now they do not exist. Volvo is now Chinese but developed in Sweden ;) Commented Aug 4, 2015 at 16:14
  • 1
    Thanks @DannyEngelman this really helped. In the end I put what I was getting from the SharePoint list into an Array and using a for loop appended each item: var array = [oListItem.get_item('Title')]; for (var i = 0; i < array.length; i++) { var option = document.createElement("option"); option.value = array[i]; option.text = array[i]; var select = document.getElementById("currencyDropdown"); select.appendChild(option);
    – Adam13Hylo
    Commented Aug 7, 2015 at 15:09
  • If the question was answered, please press the Answer button, keeps No-Answers hunters and everyone else on StackOverflow happy. Commented Aug 8, 2015 at 12:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.