473,385 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Adding a line break to a Panel-Object

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
Nov 18 '05 #1
1 11769
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" <th****************@bayern-mail.de> wrote in message
news:bv**********@svr7.m-online.net...
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

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Roland Dalmulder | last post by:
Hello all, In my PHP script I put a text file into a string. Part of that string is read, changed and removed. The while loop continuest to extract the next part of the string. This goes all...
5
by: Wai Yip Tung | last post by:
When I do for line in fp: the line string usually has a '\n' at the end. In many cases I don't want the line break character. I can trim it using if line.endswith('\n'): line = line ...
3
by: michael | last post by:
On my ASP.NET pages, it seems that _after_ any web or user control - an extra (small) line break or space is inserted automatically right after the Control. This is unwanted since it messes up...
6
by: Nurchi BECHED | last post by:
Hello, All! I have created an application with a multiline textbox on the form. When I press a button, it has to show something and then break the line and show something else. I tried "\n",...
1
by: Agent Michael Scarn | last post by:
Hello All, After I submit a form it goes to a post page where I have a javascript that creates one variable that has all of the element names from the form listed out like so: ...
3
by: lmawler | last post by:
Hi all, I know when I do data entry, I can force a line break in a text box by using Control & Enter. I'm trying to insert a line break in a field (that behaves like Control Enter) from VB. ...
1
by: jakdjak1 | last post by:
how can i create a line break so that actionscript reads it. i am using variable dynamic text boxes which are then scripted into an email script. The basic script i'm using is: on (release)...
4
by: deerchao | last post by:
Hi, I'd like to render colorful text with word wrap on screen (kind of inline <fonttag to change text color in html), but run into the line break problem. Graphics provides several DrawString...
1
by: mccalla | last post by:
Hi all, Tricky question. I know how to remove line break characters and spaces by using the code below: $message =~ s/\n//g; $message =~ s/\s//g;
7
by: jeddiki | last post by:
Hi, I am using a function called htmlwrap() which states that it does NOT add a "<br>" to the 70 character line so that it forces a line wrap. ( the script safely wraps long words without...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.