Solved

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

Posted on 2007-11-28
6
302 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

911 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

22 Experts available now in Live!

Get 1:1 Help Now