?
Solved

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

Posted on 2007-12-04
2
Medium Priority
?
416 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 19

Accepted Solution

by:
DreamMaster earned 375 total points
ID: 20410052
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
ID: 20463198
Glad to have been helpful :)

Regards,
Max.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

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