Solved

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

Posted on 2007-11-28
6
301 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now