473,889 Members | 1,489 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple TableCell.Conro ls.Add(control) - How <BR> between them?

I'm adding several controls to a cell, but want them all to have a <BR>
between them. What's the easiest way?

I'm doing something like this:

HyperLink link = new Hyperlink();
//I setup the link target, navigateurl, etc here
Label lblDescription = new Label();
//I setup the lblDescription. Text here
Label lblName = new Label();
//I setup the lblName.Text here

TableCell cell = new TableCell();
cell.Controls.A dd(link);
cell.Controls.A dd(lblDescripti on);
cell.Controls.A dd(lblName);
Now all the controls are just run together. Is there a property on the
controls to set to include <BR> after them? doing something like cell.Text
+= "<BR>" between them doesn't work, it erases to content of the cell...

Thanks in advance for the help,
Craig
Nov 18 '05 #1
4 3043
Craig wrote:
I'm adding several controls to a cell, but want them all to have a <BR>
between them. What's the easiest way?

TableCell cell = new TableCell();
cell.Controls.A dd(link);
cell.Controls.A dd(lblDescripti on);
cell.Controls.A dd(lblName);


Hello Craig,

Between adding the link and lblDescription
and between adding the lblDescription and lblName,
you can add LiteralControls that contain the "<BR>".

Best regards,

Eric
Nov 18 '05 #2
You can set up a System.Web.UI.W ebControls.Lite ral object to have the text
"<br/>" and then add this control to the controls collection of the cell.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Craig" <cs******@remoo vdis.kc.rr.com> wrote in message
news:eW******** ******@TK2MSFTN GP11.phx.gbl...
I'm adding several controls to a cell, but want them all to have a <BR>
between them. What's the easiest way?

I'm doing something like this:

HyperLink link = new Hyperlink();
//I setup the link target, navigateurl, etc here
Label lblDescription = new Label();
//I setup the lblDescription. Text here
Label lblName = new Label();
//I setup the lblName.Text here

TableCell cell = new TableCell();
cell.Controls.A dd(link);
cell.Controls.A dd(lblDescripti on);
cell.Controls.A dd(lblName);
Now all the controls are just run together. Is there a property on the
controls to set to include <BR> after them? doing something like cell.Text += "<BR>" between them doesn't work, it erases to content of the cell...

Thanks in advance for the help,
Craig

Nov 18 '05 #3
Take a look at Literal Control.

"Craig" <cs******@remoo vdis.kc.rr.com> wrote in message news:<eW******* *******@TK2MSFT NGP11.phx.gbl>. ..
I'm adding several controls to a cell, but want them all to have a <BR>
between them. What's the easiest way?

I'm doing something like this:

HyperLink link = new Hyperlink();
//I setup the link target, navigateurl, etc here
Label lblDescription = new Label();
//I setup the lblDescription. Text here
Label lblName = new Label();
//I setup the lblName.Text here

TableCell cell = new TableCell();
cell.Controls.A dd(link);
cell.Controls.A dd(lblDescripti on);
cell.Controls.A dd(lblName);
Now all the controls are just run together. Is there a property on the
controls to set to include <BR> after them? doing something like cell.Text
+= "<BR>" between them doesn't work, it erases to content of the cell...

Thanks in advance for the help,
Craig

Nov 18 '05 #4
Thanks guys - I have overlooked the literal control all this time
apparently... it works great.
"Craig" <cs******@remoo vdis.kc.rr.com> wrote in message
news:eW******** ******@TK2MSFTN GP11.phx.gbl...
I'm adding several controls to a cell, but want them all to have a <BR>
between them. What's the easiest way?

I'm doing something like this:

HyperLink link = new Hyperlink();
//I setup the link target, navigateurl, etc here
Label lblDescription = new Label();
//I setup the lblDescription. Text here
Label lblName = new Label();
//I setup the lblName.Text here

TableCell cell = new TableCell();
cell.Controls.A dd(link);
cell.Controls.A dd(lblDescripti on);
cell.Controls.A dd(lblName);
Now all the controls are just run together. Is there a property on the
controls to set to include <BR> after them? doing something like cell.Text += "<BR>" between them doesn't work, it erases to content of the cell...

Thanks in advance for the help,
Craig

Nov 18 '05 #5

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

Similar topics

1
3789
by: Jimbo | last post by:
Hello, I'm not a perl programmer but I can kind of hack my way through some simple scripts. What I am trying to do is get it so a line break <br> is automatically placed when I hit the return key in a text box in this script: http://mosaikum.org/sonst/pws.html It will add the <br> automatically to the Add Story function, but not the edit text function. I'm trying to get it to do it in the edit
4
7868
by: fis | last post by:
Hi all, I've problem because there are needed break lines in my texts on the web site but i can't do it :( My pipeline looks like: XMS -> I18N -> XSLT -> HTML I have lot of texts in my "languages" files and these are describes for things on my website. Example text looks like this:
25
5037
by: Shannon Jacobs | last post by:
Maybe there is a simple trick here, and I'm not spotting it... Is there a guru of CSS hanging around here who can help out? The page in question has a multi-column table with a list of links in each column. Because links are added and deleted separately in each column, it would be exceedingly awkward to use a separate table row for each link. Therefore, within each column the links are separated by <br> tags. However, the automatic line...
7
2758
by: Rocky Moore | last post by:
I have a web site called HintsAndTips.com. On this site people post tips using a very simply webform with a multi line TextBox for inputing the tip text. This text is encode to HTML so that no tags will remain making the page safe (I have to convert the linefeeds to <BR>s because the Server.EncodeHTML does not do that it seems). The problem is that users can use a special tag when editing the top to specify an area of the tip that will...
2
1964
by: Quentin Huo | last post by:
Hi, I am trying to dynamically create <asp:TextBox> controls in a page, like: Label lbl = new Label(); TextBox1 = new TextBox();
7
3636
by: Nathan Sokalski | last post by:
Something that I recently noticed in IE6 (I don't know whether it is true for other browsers or versions of IE) is that it renders <br/and <br></br> differently. With the <br/version, which is what most people use when they write static code (some people use <br>, but with xhtml you are required to close all tags), IE6 simply breaks to the next line like it is supposed to. However, with <br></br>, which is what is sometimes generated by...
11
1937
by: Dameon99 | last post by:
HI, Im new to PHP completely but Im wanting to format the inputs for $order and $specialinstructions so that the /n of input is replaced with <br /> tags in the html. Ive heard about using nl2br() and Ive tried a rediculous number of things to try to make it work and use it properly from entries from many different forums. Can anyone please have a look at my code and let me know how I can implement this?! <?php // multiple recipients...
2
1588
by: Defacta | last post by:
Hello ! How to delete all the new lines and replace them by <br>, because new lines involves Javacript Error, IE: facts_infos = "In 1972 he was done for murdering a colleague over a matter of $30! <br /> He served 2 years for this and was never seen again, blah blah blah." What I do is:
1
2810
by: xoinki | last post by:
hi all, I have a very large string with no space and i am putting that in a table cell. 1) Problem is that it does not wrap if a string does not have space in between and i want to force wrap it since an ugly horizontal scrollbar is coming inspite of proper percentage width assigned to the respective <thead>. 2) So a workaround which we found was to break the large string at regular intervals and add <BR> in between so that it wraps....
0
9962
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11198
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10791
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9609
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7993
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5829
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4647
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4251
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3256
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.