Use an array to populate a listbox?

前端 未结 4 1514
旧巷少年郎
旧巷少年郎 2021-01-16 11:00

The website I am working on will contain a drop-down list that shows a number of reason codes.

Is it possible to populate a drop-down list with an array derived from

4条回答
  •  难免孤独
    2021-01-16 11:22

    Just a thought, but how about:

    this.ddlReasonsWhy.Items.Add(reasonsList.getReasons().Select(r => new ListItem(r)));
    

提交回复
热议问题