Textbox Carriage Return

D

dancer

Using ASP.Net and VB.net

I have textboxes (<asp:textbox id......>) in which the user will be entering
paragraphs.
They are multiline (several rows and several columns).
The carriage returns that the user puts in (return/enter key) do not show up
when the data is retrieved. It is one long line.
Is there any way to make the user's paragraph divisions show up in the
report?
 
M

Mark Fitzpatrick

Keep in mind, the text they are typing is plain ASCII text. It includes
line-breaks but they're ASCII text linebreaks. That means when you retrieve
them and display them in a web page it's meaningless because they aren't
HTML line breaks. You just need to do a Replace() on the text string and
replace the carriage return linefeed with a <br /> element. I believe in
VB.Net this is a vbCrLf for both a carriage return and linefeed. Pass this
to the replace as Replace(vbCrLf,"<br />")
 
D

dancer

YEA!!! It works!
Thank you.


Mark Fitzpatrick said:
Keep in mind, the text they are typing is plain ASCII text. It includes
line-breaks but they're ASCII text linebreaks. That means when you
retrieve them and display them in a web page it's meaningless because they
aren't HTML line breaks. You just need to do a Replace() on the text
string and replace the carriage return linefeed with a <br /> element. I
believe in VB.Net this is a vbCrLf for both a carriage return and
linefeed. Pass this to the replace as Replace(vbCrLf,"<br />")
 

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,754
Messages
2,569,527
Members
44,999
Latest member
MakersCBDGummiesReview

Latest Threads

Top