Hi.
I am developing an application using .NET Compact Framework for Windows Mobile 5. I want to use a WebBrowser control to display some html text inside of the WebBrowser.
To do so, I am setting the property DocumentText of the control to the desired text.
When the application runs, the text is displayed, but then the control enters an infinite loop of document refreshes. This means that the control will refresh the text entered and the control cannot be used. When this code runs inside the Emulator for WM5, the application crashes. However, when the application is deployed to the device, the infinite loop efect happens, but the application doesn't crash.
I noticed that this effect happens only when the text beeing set contains an external reference (something like an IMG tag). I posted the code that I use to set the text below:
webBrowser1.DocumentText = string.Format("sfqasdf <img src=\"{0}\" width=\"{1}\" height=\"{2}\">",
@"http://weblogs.studentclub.ro/Themes/default/images/common/title.gif", 1, 1);
I have tried to use the Navigate() method to navigate to a page that contains that text, but the same thing happens.
Any ideas

WebBrowser bug in .NET Compact Framework?
H_M_A_M_A
Hi!
You have to install .NET Compact Framework 2.0 SP1 Redistributable and then you can use DocumentText (set) property with img tag.
Regards.
Seba
HeDrums
I got solution through your answer. On my emulators no flickering now. but What about user devices. do they also need to load CF 2.0 SP1 compulsorly.
If it is compulsory, I want to check the device whether it has CF2.0 SP1. If it does not have CF2.0 SP1, I want to put a message to the user to install CF2.0 SP1.
But how to check whether the CF version is SP1
I hope you can guide me.
Thanks in Advance,
liunate
I noticed that bug too. It indeed seems to be related to the fact that you have images in your page. If you filter them out the refresh bug doesn't seem to occur.
I solved it by saving the html to a temporary file and then using the navigate method to open the file on the device using a file:// url. Then it works.
/Erwin
aldo_valerio
Do the customers also to load .NETCF2.0 SP1 on their devices I am little confused here.
babysox76
Yes, the Navigate() method can be a solution. However, because you need to go through a file, you have a performance hit that I wanted to avoid.
I would have liked to be able to set the text using the DocumentText property
.