Highlithing words + asp

P

Paulo

On the classic asp how can I return the words highlited on a search field
with the tag below:
<span style="background-color:#FFFF00">KeyWord returned</span>

So if I search a bookStore with the keyword, example: asp
"Select Title from books where title like '%asp%' "

if returns me:

"Learn asp in 10 days", will just highlited on screen: "Learn <asp> in 10
days"
"Creating components in asp", will just highlited on screen: "Creating
components in <asp>"

How to do it in classic asp?
 
B

Bob Barrows

Paulo said:
On the classic asp how can I return the words highlited on a search
field with the tag below:
<span style="background-color:#FFFF00">KeyWord returned</span>

So if I search a bookStore with the keyword, example: asp
"Select Title from books where title like '%asp%' "

if returns me:

"Learn asp in 10 days", will just highlited on screen: "Learn <asp>
in 10 days"
"Creating components in asp", will just highlited on screen: "Creating
components in <asp>"

How to do it in classic asp?

Use the Replace function:
hiliteprefix="<span style=""background-color:#FFFF00"">"
hitlitesuffix="</span>"
srchword="asp"
srchResult=<one of the results of the search>
srchResult=Replace(srchResult,srchword, _
hiliteprefix & srchword & hitlitesuffix)

Response.Write srchResult
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top