Problem with multiple lines in db data

L

Loading name...

hey

asp.net 2.0

In my db (sql server 2005) I have a record which consist of multiple lines:
"HEY
THIS IS A TEST
OF MULTIPLE
LINES"

But when I retrieve this value and put it into a formview field, the data is
displayed like this:
"HEY THIS IS A TEST OF MULTIPLE LINES"

Some of the settings on the textbox displaying the datafield on one row (I
want it to display multiple lines)
<asp:TextBox TextMode="MultiLine" ID="jalla" runat="server"... >
</asp:TextBox>

Any suggestions to what I should do to get this datafield displaying the
original text (multiple lines)?
 
J

John Timney \(MVP\)

When you set the TextMode attribute to "Mulitline", the control will render
as an HTML TextArea. Your text has to be html compliant to display on
multiple lines so you need to take a look at the output and see whats being
displayed. Sometimes, replacing carriage returns with <br> or wrapping the
whole section in <pre> tags may be necessary but it all depends on what went
into your database in the first place.

Regards

John Timney (MVP)
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,058
Latest member
QQXCharlot

Latest Threads

Top