c# - How to populate UL from code-behind -


i have ul in asp.net page:

<ul id="ulo" runat="server"> </ul> 

code-behind:

foreach (string wrwg in workgrouplists) {     // add each "wrwg" list item `ulo` } 

i tried using asp:repeater populate didn't work.

this work:

foreach (string wrwg in workgrouplists) {   htmlgenericcontrol li = new htmlgenericcontrol("li");   li.innertext = wrwg;    ulo.controls.add(li); } 

Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -