Search HouseOfScripts.com

 

All Scripts        JavaScripts        ASP Scripts        Other Scripts

 

  Display line breaks on the page from the Recordset:

Line breaks in memo or text database fields are not displayed in a web browser. Rather, the text looks like it is all part of the same paragraph or block of text.

The normal ASCII line break character from the database is not recognized by web browsers. Web browsers only recognize the HTML <br> and <p> tags to display line breaks.

This is how is the solution for you.

<%=Replace(Recorset.Fields.Item("Problem").Value,Chr(13),"<br>")%>

in some cases (if you have Null in the table) you have to use this code:

<%
If Not IsNull(Recorset.Fields.Item("Notes").Value) Then
Response.Write(Replace(Recorset.Fields.Item("Notes").Value, vbNewLine, "<br>"))
End If
%>

 


Home       Scripts       Active WebTools       Web Templates       Forum       Tools        Hosting       Questions/Comments       Add/Request