Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

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
?
424 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

596 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