When working in codebehind, I often create an HTML list using the following method:
HtmlGenericControl list = new HtmlGenericControl("ul");
for (int i = 0; i < 10; i++)
{
HtmlGenericControl listItem = new HtmlGenericControl("li");
Label textLabel = new Label();
textLabel.Text = "Menu"+i;
listItem.Controls.Add(textLabel);
list.Controls.Add(listItem);
}
However, I have encountered an issue where the rendered list displays bullets, which is not the desired outcome.