Click here to Skip to main content
12,507,058 members (62,624 online)
Rate this:
 
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
Updated 23-Sep-12 21:38pm
D-Kishore4.2K
v2

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160927.1 | Last Updated 24 Sep 2012
Copyright © CodeProject, 1999-2016
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