| | |
highlighting search results in a gridview problem
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2008
Posts: 41
Reputation:
Solved Threads: 0
hi, i have a gridview search which filters the gridview, displaying the search results, however it wont highlight the results in yellow:
can any1 see a problem?
cheers
c# Syntax (Toggle Plain Text)
//Highlight relevant search results public string Highlight() { //Declaring a variable to hold search query string s = txtSearch.Text; if (s != null) { //string Search_Str = txtGrid.Text.ToString(); // Setup the regular expression Regex RegExp = new Regex(s.Replace(" ", "|").Trim(), RegexOptions.IgnoreCase); //Highlight keywords by calling the delegate //each time a keyword is found. return RegExp.Replace(s, new MatchEvaluator(ReplaceKeyWords)); // Set the RegExp to null. //RegExp = null; } else { return s; } } // Method which helps find and highlight search results public string ReplaceKeyWords(Match m) { return "<span class=highlight>" + m.Value + "</span>"; }
can any1 see a problem?
cheers
BETTER YOU VISIT:
http://www.highoncoding.com/Articles...w_Control.aspx
http://www.highoncoding.com/Articles...w_Control.aspx
MARK AS SOLVED if its help you.
REGARDS
MCTS - Shawpnendu bikash maloroy
http://shawpnendu.blogspot.com
REGARDS
MCTS - Shawpnendu bikash maloroy
http://shawpnendu.blogspot.com
![]() |
Other Threads in the ASP.NET Forum
- Previous Thread: CSS for asp:button control
- Next Thread: To search records
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax appliances asp asp.net beginner bottomasp.net box browser businesslogiclayer button c# c#gridviewcolumn cac checkbox child class click compatible confirmationcodegeneration content contenttype control countryselector courier css database datagrid datagridview datalist deadlock deployment development dgv dialog dropdownmenu dynamic edit embeddingactivexcontrol feedback fileuploader fill findcontrol flash flv form forms gridview gudi homeedition hosting iframe iis javascript jquery list menu mono mssql multistepregistration nameisnotdeclared novell objects order problem ratings redirect registration relationaldatabases rotatepage search security select serializesmo.table sessionvariables silverlight smartcard sql ssl tracking treeview typeof validatedate validation vb.net virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopment wizard xml xsl





