Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Adding a line break to a Panel-Object

Reply
Thread Tools

Adding a line break to a Panel-Object

 
 
Thomas Reichgruber
Guest
Posts: n/a
 
      01-31-2004
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


 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      01-31-2004
MyPanel.Controls.Add(New LiteralControl("<br>"))

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

"Thomas Reichgruber" <> wrote in message
news:bvgosr$75c$...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding line break to HTML textarea probodha Software 0 09-08-2011 04:50 PM
Read a file line by line and write each line to a file based on the5th byte scad C++ 23 05-17-2009 06:11 PM
`if (!p ? i++ : 0) break;' == `if (!p){ i++; break;}' ? lovecreatesbea...@gmail.com C Programming 12 04-14-2008 07:59 AM
How to read a text file line by line and remove some line kaushikshome C++ 4 09-10-2006 10:12 PM
Read a file line by line with a maximum number of characters per line Hugo Java 10 10-18-2004 11:42 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57