Highlighting Certain words in a document

S

Stephajn Craig

Is there a way that I can have a page do some highlighting based on a set of
given keywords?

The scenario is that a user does a search for certain keywords, and then the
items returned have the words that cause them to be a match highlighted as
the user looks through the item.
 
D

David Waz...

Yep, you can use filters on the output...

I've never done it - (of course) :)
but i remember reading that you can place a filter on
outgoing documents. you could then do string replacement
on the output stream.
 
C

clintonG

Actually, given the ability to parse the response a CSS declaration
such as a span including a class that defined a background color
would meet the requirement...

<span class="TextHighlight">the words</span>

--
<%= Clinton Gallagher
A/E/C Consulting, Web Design, e-Commerce Software Development
Wauwatosa, Milwaukee County, Wisconsin USA
NET (e-mail address removed)
URL http://www.metromilwaukee.com/clintongallagher/

LaGarde StoreFront 5 Affiliate: e-Commerce Software Development
SEE: http://www.storefront.net/default.asp?REFERER=-201499070







John Timney (Microsoft MVP) said:
You could always just surrounding the words on output with html tags
containing the word <strong>the words<strong/>, uisng a regular expression
replace, or string replace

--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
----------------------------------------------
 

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,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top