Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASM
Hello Friends,
I am creating IE BHO in which Browser words that matched with database gets highlight and onmousehover description is getting displayed as popup. Till now everything is running fine.
Below is my code
oleda.SelectCommand = cmd;
                // Filling OleDataAdapter value in DataTable Object dt
                oleda.Fill(dt);
                if (dt.Rows.Count > 0)
                {
                    string TextToHighlight = "", TextAsDiscription = "";
                    int count = dt.Rows.Count;
                    for (i = 0; i < count; i++)
                    {
                        TextToHighlight = "";
                        TextAsDiscription = "";
                        TextToHighlight = dt.Rows[i]["words"].ToString().ToLower();
                        TextAsDiscription = dt.Rows[i]["Definition"].ToString().ToLower();
                        if (Regex.IsMatch(PageText, string.Format(@"\b({0})\b", TextToHighlight)))
                        {
                            TotalWordCount++;
                            PageText = HighlightSearchKeyWords(TextToHighlight, TextAsDiscription, PageText);
                            MatchedWords = MatchedWords + TextToHighlight + ",";
                        }
                    }
                }
                document.body.innerHTML = PageText;
My problem is in Pagetext variable complete data is coming along with Single quotes in word description but after assign to document.body.innerHTML, words description getting truncated after single quotes.
 
Can anybody suggest me the issue or any solution for this.
 
Please help me in sorting out this issue.
 
Thanks
Posted 23-Sep-12 21:36pm
Edited 23-Sep-12 21:38pm
4K
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 634
1 OriginalGriff 355
2 CPallini 205
3 RyanDev 161
4 Hard_Rockz 140
0 OriginalGriff 5,689
1 Sergey Alexandrovich Kryukov 4,803
2 Peter Leow 2,974
3 Maciej Los 2,819
4 DamithSL 2,465


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 24 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100