Click here to Skip to main content
15,881,027 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
C#
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
Updated 23-Sep-12 21:38pm
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900