Solved

ASP.NET 2005, IE 6 - Highlight Searched Keywords Within A Text Block Displayed In A Grid

Posted on 2007-12-04
2
364 Views
Last Modified: 2013-11-26
Experts,
How do i highlight matching words displayed in a grid if i have a keyword in a variable?
0
Comment
Question by:feesu
  • 2
2 Comments
 
LVL 19

Accepted Solution

by:
DreamMaster earned 125 total points
Comment Utility
The easiest way to do this is to write out the page that was found, and then do a replace on the keywords that were searched for.

So lets say your keyword is in a variable called "searchword"

You are writing out a result as the text for a page, lets say the variable for that is called pagetext

Now you write out the pagetext and do this:

pagetext.Replace(searchword, "<span class=""highlighted"">" & searchword & "</span>")

Now all you need to do is create a stylesheet for that span class="highlighted"

Hope this makes sense.
Regards,
Max.
0
 
LVL 19

Expert Comment

by:DreamMaster
Comment Utility
Glad to have been helpful :)

Regards,
Max.
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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 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

11 Experts available now in Live!

Get 1:1 Help Now