I've got this web control that I've been dynamically adding controls to but now the requirement is to add an ordered list around the controls.
To render the controls I add the controls to ControlsCollection
protected void Page_Load(object sender, EventArgs e)
{
var document = XDocument.Load(@"http://localhost:49179/XML/Templatek.xml");
var builder = ObjectFactory.GetInstance<IControlBuilder>();
var controls =builder.BuildControls(document);
controls.ToList().ForEach(c => Controls.Add(c));
}
And this is the html+aspnet ctrls I want to build:
<fieldset>
<ol>
<li>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</li>
<li>
<asp:TextBox runat="server" ID="TextBox1"></asp:TextBox>
</li>
</ol>
</fieldset>
How do I position the controls in the list items? Do I need to approach the problem differently?