Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add a <br /> to an asp.net placeholder

Tags:

asp.net

If I have an asp.net web page with placeholders, what is the simplest way to wrap a line break
into a control that I can pass to the Add function of the placeholder?

like image 433
chuck taylor Avatar asked Dec 21 '10 21:12

chuck taylor


3 Answers

You could add it as an HtmlGenericControl:

yourPlaceholder.Controls.Add(new HtmlGenericControl("br"));
like image 192
Andrew Hare Avatar answered Oct 15 '22 05:10

Andrew Hare


Or use a Literal Control (new LiteralControl("<br />"))

like image 22
dko Avatar answered Oct 15 '22 05:10

dko


Just use literalcontrol

yourPlaceholder.Controls.Add(new LiteralControl("<br />"))
like image 40
user1546306 Avatar answered Oct 15 '22 04:10

user1546306