Solved

In Classic ASP, How do I display <br> ?

Posted on 2007-11-28
6
306 Views
Last Modified: 2010-04-21
Hello.
In Classic ASP coding, I used this coding below to display <br>
Description = replace(rs("Description"),chr(13) & chr(10),"<br>")

But here is the problem.
In this page there are many rs("Descriptoin") and since I replace the rs("Description") into Description, it's displaying same description in the page.

What do I have to do?
0
Comment
Question by:erin027
6 Comments
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20364019
Use this and let me know
Description = Replace(Replace(Replace(rs("Description"), vbCrLf,"<br>"), vbCr, "<br>"), vbLf, "<br>")
0
 
LVL 11

Expert Comment

by:Sven
ID: 20364077
If there is displaying the same description over an over again, are you sure you are calling rs.MoveNext ? Or am I totaly missunderstanding your question?
0
 

Author Comment

by:erin027
ID: 20364079
Thank you asvforce.
But the problem didn't solve.
<br> works, but my problem was because of the replacement, recordset is showing same results.
Here is my coding.
Thank you.

<% if rs.BOF or rs.EOF then %>
<%else
Description = Replace(Replace(Replace(rs("Description"), vbCrLf,"<br>"), vbCr, "<br>"), vbLf, "<br>")
i=1
Do until rs.EOF
%>

<%=rs("title")%>
<%=description%>

<%
rs.MoveNext
i=i+1
loop
End if
%>
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Accepted Solution

by:
Ashish Patel earned 125 total points
ID: 20364092
Do this
<% if rs.BOF or rs.EOF then %>
<%else
i=1
Do until rs.EOF
Description = Replace(Replace(Replace(rs("Description"), vbCrLf,"<br>"), vbCr, "<br>"), vbLf, "<br>")

%>

<%=rs("title")%>
<%=description%>

<%
rs.MoveNext
i=i+1
loop
End if
%>
0
 

Author Closing Comment

by:erin027
ID: 31411374
Thank you!
0
 
LVL 11

Expert Comment

by:Rajesh Dalmia
ID: 20364124
instead of storing value in variable and then print better u do this

instead of

<%Description = Replace(Replace(Replace(rs("Description"), vbCrLf,"<br>"), vbCr, "<br>"), vbLf, "<br>") %>
<%=description%>

do redirectly

<%=Replace(Replace(Replace(rs("Description"), vbCrLf,"<br>"), vbCr, "<br>"), vbLf, "<br>") %>

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question