Link to home
Start Free TrialLog in
Avatar of joshuadavidlee
joshuadavidlee

asked on

Line breaks in Textbox go missing when transfered to label

I have a text box where people post stuff and they write lines and press the ENTER button for ne wlines and write more lines etc .
I then save the text in the database when they press the update button.
the problem is when i go to read from the database and display the text in a label the lable shows it as one big text block with out the new lines?  How do i save it to database pproperly or get the line breaks to show up int he label or something?
ASKER CERTIFIED SOLUTION
Avatar of mrichmon
mrichmon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ibost
ibost

the text in a label needs to use the html tags <BR> to show a line break.

You'll need to parse it.

One way is if you return data from a database try

select
   replace(MyColumn, char(13), '<BR>')

from MyTable

where ...



Alternatively you can parse it yourself:
http://www.mastercsharp.com/article.aspx?ArticleID=28&&TopicID=6


-Ian