Highlighting Certain words in a document

  • Thread starter Thread starter Stephajn Craig
  • Start date Start date
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.
 
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.
 
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>
----------------------------------------------
 
Back
Top