chuck taylor
chuck taylor

Reputation: 2516

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

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?

Upvotes: 8

Views: 7277

Answers (3)

user1546306
user1546306

Reputation: 41

Just use literalcontrol

yourPlaceholder.Controls.Add(new LiteralControl("<br />"))

Upvotes: 4

dko
dko

Reputation: 894

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

Upvotes: 11

Andrew Hare
Andrew Hare

Reputation: 351516

You could add it as an HtmlGenericControl:

yourPlaceholder.Controls.Add(new HtmlGenericControl("br"));

Upvotes: 16

Related Questions