473,386 Members | 1,766 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,386 software developers and data experts.

LINE BREAK ISSUE

Hi all,

have a line of code in a ViewLocation.aspx.cs file below

StringBuilder sb = new StringBuilder();
sb.Append("Driver No:
").Append(driver.DriverNo.ToString()).Append("<br> ");
sb.Append("Name: ").Append(driver.FirstName).Append("
").Append(driver.LastName).Append("<br>");
sb.Append("Phone: ").Append(driver.PDAPhoneNumber);

Problem is when it is displayed on the page it shows like this

Driver No: 1<br>Name: Donald Stewart<br>Phone etc etc

Should be

Driver No: 1
Name: Donald Stewart
Phone: 07912 000000 etc etc

Anyone help?

Regards
Simon
--
Simon Gare
The Gare Group Limited

website: www.thegaregroup.co.uk
website: www.privatehiresolutions.co.uk
Mar 17 '07 #1
1 1236
Simon Gare wrote:
Hi all,

have a line of code in a ViewLocation.aspx.cs file below

StringBuilder sb = new StringBuilder();
sb.Append("Driver No:
").Append(driver.DriverNo.ToString()).Append("<br> ");
sb.Append("Name: ").Append(driver.FirstName).Append("
").Append(driver.LastName).Append("<br>");
sb.Append("Phone: ").Append(driver.PDAPhoneNumber);

Problem is when it is displayed on the page it shows like this

Driver No: 1<br>Name: Donald Stewart<br>Phone etc etc

Should be

Driver No: 1
Name: Donald Stewart
Phone: 07912 000000 etc etc

Anyone help?
The problem is not in the code that you have shown, but in the code that
you haven't shown. The StringBuilder doesn't show anything on the page,
it only creates a string. It's the way that you display the string on
the page that decides how it's going to show up.

You are using a method that html encodes the string when it's shown on
the page. What you want to do is to use a method that doesn't.

--
Göran Andersson
_____
http://www.guffa.com
Mar 17 '07 #2

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

Similar topics

12
by: dan glenn | last post by:
Hi. I'm finding that if I have text entered into a <textarea ...> </textarea> in a form, and that text has leading blank lines (with no spaces or anything else), that when I retrieve the entered...
4
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...
19
by: Philipp Lenssen | last post by:
I don't know the English word, but I'm referring to the double-dash which is used to separate parts of a sentence. I'm using — so far. Now I saw – which is slightly shorter. Some sites use --. ...
5
by: Mike Mimic | last post by:
Hi! I am programming small program which would use its own text based network protocol. I come to the problem with ending lines. I was thinking about ending them with \r\n combination. But the...
23
by: FrancisC | last post by:
#include <stdio.h> int file_copy( char *oldname, char *newname ); int main() { char source, destination; printf("\nEnter source file: ");
4
by: News | last post by:
Hi Everyone, The attached code creates client connections to websphere queue managers and then processes an inquiry against them. The program functions when it gets options from the command...
9
by: jsummit | last post by:
I'm trying to parse a rather large string from a .txt file that breaks into 2 lines ( the string is a fixed-length string reaching 6694 characters) into a dataset using VB.net. The issues that I am...
10
by: Itaichuk | last post by:
Hi I read in several CSS tutorials that block-level elements, such as <div& <pare rendered with an implicit line break before and after. I set to test this out using the following HTML: I...
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...
15
by: puzzlecracker | last post by:
What is the quickest way to check that the following: const line; only contains whitespace, in which case to ignore it. something along these lines: isspacedLine(line); Thanks
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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,...
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,...

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.