I am adding labels to the page programmaticaly(codebehind file c#)
Label label1 = new Label();
label1.Text = "abc";
this.Page.Form.FindControl("ContentPlaceHolder1").Controls.Add(label1);
Label label2 = new Label();
label2.Text = "def";
this.Page.Form.FindControl("ContentPlaceHolder1").Controls.Add(label2);
I want to add hr and br between these labels.How to do that?
this.Page.Form.FindControl("ContentPlaceHolder1").Controls.Add("<hr/>");
doesn’t work.
1 Answer