2010-12-21 16 views

risposta

13

Si potrebbe aggiungerlo come HtmlGenericControl:

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

ma questo sarà il rendering:

+0

Un problema con questo è che esegue il rendering di due tag
. Puoi vedere un altro post su questo problema qui: https://stackoverflow.com/questions/13493586/htmlgenericcontrolbr-rendering-twice. – Hawkeye

8

Oppure utilizzare un controllo Literal (new LiteralControl("<br />"))

+0

1+ per generare meno HTML nel browser –

3

Basta usare LiteralControl

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