Wednesday, February 11, 2009

C# - Handling symbols in webbrowser control


We will be facing issues with WebBrowser control in C#.net for handling symbols such as Ø,½ and ±. We may face issues even when we set appropriate character encoding for the webbrowser control. It seems documenttext property is not handling symbols properly. To overcome this issue, we can get the header and body details separately instead of using documenttext.

The code can be written as below,
string strhead = webBrowser1.Document.GetElementsByTagName("head")[0].OuterHtml;
string strbody = webBrowser1.Document.Body.OuterHtml;
string strhtml = strhead + strbody;
More Articles...

No comments:

Search This Blog