HELP needed in retaining paragraphs using ASP

J

John

Hello all,
Can anyone tell me if its possible to retain paragraph breaks when
displaying a txt document from an Access database using ASP.

As it is right now, when the document is displayed on a web page, all
the paragraphs are closed up into one long block of text.

If the above isn't possible, then would it be possible to insert
paragraph tags within the text in the appropriate places using ASP.

TIA.
 
C

Cowboy (Gregory A. Beamer) - MVP

IN ASP, you can do a search for the CRLF character and replace it with a
"<p>". That should be how the line breaks are stored in Access.

---

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

***************************
Think Outside the Box!
***************************
 
K

Kevin Spencer

You can also enclose the text in <pre> tags. This does, however, remove all
font formatting, and usually displays the text as Courier.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
J

John

Thanks for responding Cowboy.
Any chance of a bit of sample code to help me along? Assume the text
file is called "FRED"
TIA
 
J

John

Many thanks for responding.
If the <pre> tag removes all formatting, wouldn't it then also remove
all spacing between paragraphs?
Also, would I have one pre tag at the beginning of the text and
another at the end, or at the beginning and end of each paragraph?
TIA
 
S

Stefan B Rusynko

If the DB field is named say: Description
and you are opening the table using objRS

<%=Replace(objRS("Description"), vbCrLf,"<br>")%>

Recommend either <br> for a single line return or <p> for double line return



| Thanks for responding Cowboy.
| Any chance of a bit of sample code to help me along? Assume the text
| file is called "FRED"
| TIA
|
|
| On Thu, 9 Dec 2004 11:17:25 -0800, "Cowboy (Gregory A. Beamer) - MVP"
|
| >IN ASP, you can do a search for the CRLF character and replace it with a
| >"<p>". That should be how the line breaks are stored in Access.
| >
| >---
| >
| >Gregory A. Beamer
| >MVP; MCP: +I, SE, SD, DBA
| >
| >***************************
| >Think Outside the Box!
| >***************************
| >
| >"John" wrote:
| >
| >> Hello all,
| >> Can anyone tell me if its possible to retain paragraph breaks when
| >> displaying a txt document from an Access database using ASP.
| >>
| >> As it is right now, when the document is displayed on a web page, all
| >> the paragraphs are closed up into one long block of text.
| >>
| >> If the above isn't possible, then would it be possible to insert
| >> paragraph tags within the text in the appropriate places using ASP.
| >>
| >> TIA.
| >>
| >>
|
 
R

Ronx

You would place the <pre> tag at the beginning of the text, and </pre> at
the end of the text.
It would remove all formatting, but will honour all CRs within the text, so
paragraphs will display as paragraphs.

One Caveat: If the text does not contain any CRs, it will display as one
continuous line. The text will not wrap except at a new paragraph.
 
Top