I have three ul like this :
<ul id="column3" class="column" runat="server"> </ul>
<ul id="column4" class="column" runat="server"> </ul>
<ul id="column5" class="column" runat="server"> </ul>
I wanna to add listitems to them randomly:
HtmlGenericControl listItem1 = new HtmlGenericControl("li");
listItem1.Attributes.Add("class", colors[RandString.Next(0, colors.Length -1)]);
column3.Controls.Add(listItem1); //here i wanna to randomize the ul(column3,column4,column5) like i do with the colors
How to do something like that .
You could put those ul in an array
and then pick a random one:
Notice that you don’t need
uls.Length - 1because the upper bound is exclusive in the Next method.