I'm adding controls to my page in code and needed <br> between the controls to put them on new lines. I just want to write <br>'s to the page without using the HtmlAnchor control. Is there a better way than this?
Code:Label l1 = new Label(); Label l2 = new Label(); Label l3 = new Label(); HtmlAnchor an1 = new HtmlAnchor(); HtmlAnchor an2 = new HtmlAnchor(); l1.Text = "Label1"; l2.Text = "Label2"; l3.Text = "Label3"; an1.InnerHtml = an2.InnerHtml = "<br>"; Page.Controls.Add(l1); Page.Controls.Add(an1); Page.Controls.Add(l2); Page.Controls.Add(an2); Page.Controls.Add(l3);




Reply With Quote