views:

38

answers:

2

Hi,

I'm listing some controls at my web page dynamically, either I'm adding newline with Label's.

Label newLine = new Label();newLine.Text = "<br/>"; myPanel.Controls.Add(newLine);

How can I do it in a different way?

+3  A: 
myPanel.Controls.Add(new LiteralControl("<br />"));
womp
thanks! if works !
softwaremonster
@softwaremonster mark it as the correct answer, womp deserves some credit.
MatthewMartin
because i'm newbie here i have to wait for a special time to mark an answer as correct.
softwaremonster
A: 

I would suggest that you don't use
at all. Use CSS to display your controls. display:block on your elements will work just fine. Less messy!

TheGeekYouNeed
I'm using Css either but I did not know that I could do that with Css. Could you write how? Which css code should I use?
softwaremonster