Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Writing <br> in HTML using C#

Reply
Thread Tools

Writing <br> in HTML using C#

 
 
SteveB
Guest
Posts: n/a
 
      10-25-2004
How can I write a break on Web Form using C#?
 
Reply With Quote
 
 
 
 
Jeffrey Palermo [MCP]
Guest
Posts: n/a
 
      10-25-2004
HtmlGenericControl lineBreak = new HtmlGenericControl("br");
Page.Controls.Add(lineBreak);

This will work for any html tag.

Best regards,
Jeffrey Palermo

"SteveB" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> How can I write a break on Web Form using C#?



 
Reply With Quote
 
 
 
 
Lau Lei Cheong
Guest
Posts: n/a
 
      10-25-2004
1) Resonse.Write("<br>");
Probably the following will do too...
2) Page.Controls.Add(new System.Web.UI.HtmlControls.HtmlControl("br"));

But what's the use of that?

"SteveB" <(E-Mail Removed)> ???
news:(E-Mail Removed) om ???...
> How can I write a break on Web Form using C#?



 
Reply With Quote
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      10-25-2004
A LiteralControl can also work here.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside the box!
*************************************************
"Jeffrey Palermo [MCP]" <http://dotnetjunkies.com/weblog/jpalermo> wrote in
message news:(E-Mail Removed)...
> HtmlGenericControl lineBreak = new HtmlGenericControl("br");
> Page.Controls.Add(lineBreak);
>
> This will work for any html tag.
>
> Best regards,
> Jeffrey Palermo
>
> "SteveB" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) om...
>> How can I write a break on Web Form using C#?

>
>



 
Reply With Quote
 
Steve Burks
Guest
Posts: n/a
 
      10-25-2004

Thanks for the info. As far as the use here goes....

First of all let me admit that I am very new to C#.
I have established a database with 4 address fields. I know that at
times some of the fields will be empty. I am using a datalist and label
controls to present the addresses. The C# code sets the display property
of the label. I need a break between address lines only when the label
is displayed otherwise I have blank lines. Is there another way?


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
SteveB
Guest
Posts: n/a
 
      10-25-2004
Having trouble getting the linebreak to appear in the html.
I am using datalist and looping through each label control. If the label
contains information I want to display and at the same time place <br>
at that label instance. If the label is empty I want to set display to
none with no <br>. I am able to switch the display property but I am
having trouble with the <br> part. If I hard code the <br> they cause
new lines even when the label is not displayed.





*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
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
firefox html, my downloaded html and firebug html different? Adam Akhtar Ruby 9 08-16-2008 07:55 PM
Using Netbean IDE for writing/compiling/debugging apps without using Project bagarow@yahoo.com Java 6 05-11-2006 02:53 PM
writing html (client) on aspx Avi ASP .Net 1 05-05-2005 11:33 AM
Any problems with writing the information into a file - Multi-users perform writing the same file at the same time ???? HNguyen ASP .Net 4 12-21-2004 01:53 PM
Writing HTML to a webpage using document.getElementById('results').childNodes[0].nodeValue Deryck Javascript 2 09-18-2004 11:07 AM



Advertisments