simple one..... from HTML to SQL to HTML... i lose my new lines

J

Justin Rich

Im not sure where i lose the new line stuff but when i pull it back from the
DB its gone.

Im using the SQLDataSource control. i pull it and push to a asp:textbox.

i assume there is something simple i need to do?
 
A

Aaron Corcoran

Justin,

I believe that a simple replace statement should solve your problems.
If I am not mistaken, it is stored in SQL as Chr(13). You should be
able to do a replace command and replace the Chr(13) with a <BR> tag.

Let me know if this helps. I know the following is what is used when a
datagrid is populated:

<asp:TemplateColumn HeaderText="myField" Visible="True">
<ItemTemplate>
<%# myDataSet.FieldValue("myField", Container).
Replace(Chr(13), "<br>") %>
</ItemTemplate>
</asp:TemplateColumn>

Aaron
 
J

Justin Rich

FieldValue is not part of a SQLDataSource.
also what namespace is the Chr function in?

Thanks
Justin
 

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,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top