Improve company productivity with a Business Account.Sign Up

x
?
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
?
428 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 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

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Free Data Recovery software is an advanced solution from Kernel Tools to recover data and files such as documents, emails, database, media and pictures, etc. It supports recovery from physical & logical drive after a hard disk crash, accidental/inte…

595 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