I'm adding bits of blurb to a database. When I print out the blurb to screen again I would like it to include the linebreaks, carriage returns etc, but it doesn't.
The original linebreaks etc aren't being held when passed to the database.
Does anyone know how I can preserve this information? I'm using ASP and ASP.Net and Access and SQL server2000.
BeTheBall -> RE: line breaks (1/31/2006 0:38:32)
Welcome to OutFront. Try a function like this:
<% Function InsertBreak(strOutput) myString = Replace(strOutput, Chr(13), "<BR>") myString = Replace(myString, Chr(10), "<BR>") Response.write(myString) End Function %>
yb2 -> RE: line breaks (1/31/2006 18:01:53)
Thanks. Are these the only characters I should look for? I'm not sure if I should be looking for unicode characters too, as my pages are encoded in utf8??
BeTheBall -> RE: line breaks (1/31/2006 18:30:51)
I think the above should do it. The way your page is coded is probably not relevant. The issue is how the carriage returns are stored in the database. I guess if the above doesn't work, we'll know there is still something left to code for.