Paragraphs not working when returning data from SQL server

Associate
Joined
12 Oct 2010
Posts
6
I am having to support a classic asp site and there is an issue with text containing paragraphs. Users enter the text into a text box which is then stored in an SQL server table.

If they then open the record to edit the text the paragraphs are still intact, however if the text is output using response.write then the paragraphs all merge into one big ugly chunk of text. Does anyone know whats causing this and how to get around it as I am a bit stumped.

TIA :confused:
 
As white space is ignored in HTML, you need to tell the browser where to break the text.

As you're using classic ASP, try this:

Code:
HtmlFormattedString = replace(myString, vbCrLf, "<br />")

response.write(HtmlFormattedString )
 
Back
Top Bottom