ASP site CRLF commands

W

WC Justice

I have a database-driven web site that uses SQL Server for the back end, ASP
for the wide front end and Access for the local front end. I have nvarchar
fields that sometimes include paragraph breaks. There is no special command
("Enter" works fine) to force the paragraph break in Access, and the text
boxes on the web site recognize these paragraph breaks. I use text boxes
only when I am making editing available to the qualified user. When I want
to display the text in read only, I simply populate an html table cell with
the text. The problem is that the html table cell does not recognize the
paragraph breaks, so the text is displayed in run-on fashion.

I am assuming that I could use the REPLACE function at the point of display
to recognize and either replace or insert a paragraph break command that
html would recognize, but I have no idea either what to look for or what to
replace it with. Can you help?

p.s. I like the html table cell display because it grows to the size of the
text, which the text box does not (or at least I don't know how to make it
do that).

Thanks
 
G

Gérard Leclercq

Response.Write Replace(MyText,vbCrlf,"<br>")
Response.Write Replace(MyText,Chr(10)&Chr(13),"<br>")
or a variant
 
R

Ray Costanzo [MVP]

sTheText = oYourRecordset.Fields.Item("yourColumn").Value
Response.Write Replace(sTheText, vbCrLf, "<br>")

Ray at work
 
H

Hal Rosser

WC Justice said:
I have a database-driven web site that uses SQL Server for the back end, ASP
for the wide front end and Access for the local front end. I have nvarchar
fields that sometimes include paragraph breaks. There is no special command
("Enter" works fine) to force the paragraph break in Access, and the text
boxes on the web site recognize these paragraph breaks. I use text boxes
only when I am making editing available to the qualified user. When I want
to display the text in read only, I simply populate an html table cell with
the text. The problem is that the html table cell does not recognize the
paragraph breaks, so the text is displayed in run-on fashion.

I am assuming that I could use the REPLACE function at the point of display
to recognize and either replace or insert a paragraph break command that
html would recognize, but I have no idea either what to look for or what to
replace it with. Can you help?

p.s. I like the html table cell display because it grows to the size of the
text, which the text box does not (or at least I don't know how to make it
do that).

Thanks

If you need to preserve the line returns, one solution is put the <pre>
around the data
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top