Adding a line break to a Panel-Object

T

Thomas Reichgruber

Hi,

does anybody know how to add a linebreak dynamically to a Panel?
In the code behind file aspx.cs my webapplication dynamically adds
WebControls to a Panel defined in the .aspx file. This looks like this:

Button MyButton = new Button();
MyPanel.Controls.Add(MyButton);

This works great, but if I add another Button (or TextBox, or CheckList or
....) ASP.NET puts all Controls in the same line which looks awful.

So I need a way to add a line break (maybe as an special WebControl object)
to the Panel.
Is this possible or is there a way to add HTML code (e.g. <br>) to the
Panel?

Thanks
Thomas
 
K

Kevin Spencer

MyPanel.Controls.Add(New LiteralControl("<br>"))

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top