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>
JavaScript:
function successHandler() {
console.log("Success");
var listItemInfo = '';
var listItemEnumerator = collListItem.getEnumerator();
while (listItemEnumerator.moveNext()) {
var oListItem = listItemEnumerator.get_current();
console.log(oListItem.get_item('Title'));
$("#currencyDropDown").val(oListItem.get_item('Title'));
}
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.