.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Forum >> VB.Net >> Post New QuestionBookmark and Share Subscribe to Forum

In Search, Highlighting the result in a textbox. Vb.net

Posted By: Naresh     Posted Date: March 17, 2010    Points:2   Category :VB.Net

I need to Highlighting the result , which is produced by searching particular word in a database. The result is displayed in label.

I am using Vb.net as Code language


Author: Venkat             
Posted Date: March 17, 2010     Points: 5   


If I understood you correctly you can search a keyword from SQL Server and if the result matches than you have to pull the whole records and in that Paragraph you need to highlight the keyword. Is that correct?

If yes than do like this

Use full text search functionality of sql server to search the keyword and get the record from database.

Once you get the record from database use String.IndexOf("") method to find the keyword position in the record.

Once you get the position of the keyword from a record use string.Replace("","") to and use <font> tag to
highlight the keyword.

and yes do not use label use asp.net litral control to display paragraph with highlighted text. because using Label control you can not highlight the particular text, word or keyword.

Hope this will help you

Mark As Answer if this solve your problem
Warm Regards,

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend