Re: WebBrowser not displaying page in Mobile application
- From: "Rob" <bluetic@xxxxxxxxxxxxxxxx>
- Date: Thu, 18 Sep 2008 08:51:55 +0100
Sure,
In using the WebBrowser object, all appeared to work as by design except for
in a specific area of the code.
Here, when reloading the page after populating WebBrowser.DocumentText, the
page would sometime display corrupted (as if the same HTML had been added
part way through the HTML code). Under debug I could see the HTML code,
which was correct, though (stepping through the code) when the web page was
displayed in the WebBrowser object it was corrupted.
In addition to this issue, occassionally the whole application would crash
out (even when in a try catch statement). If I turned on Error Reporting in
Windows Mobile 6.0, at this point it would display an exception within
WEBVIEW.DLL.
I found that converting the WebBrowser.DocumentText to
WebBrowser.Navigate(), and creating a temporary HTML file containing the
'offending' HTML code, worked.
original code:
wb.DocumentText = sHTMLString
new code:
Dim TmpFile As String = "\My Documents\Temp.htm"
Dim oSR As IO.StreamWriter
If IO.File.Exists(TmpFile) = True Then IO.File.Delete(TmpFile)
oSR = IO.File.CreateText(TmpFile)
oSR.WriteLine(sHTMLString)
oSR.Dispose()
oSR = Nothing
wb.Navigate(New Uri("file:///my documents/Temp.htm"))
To try to standardise the code throughout my application I began converting
all instances of WebBrowser.DocumentText to WebBrowser.Navigate() (as
above), but everywhere else I used it, the page would first display as
blank. When I then held the stylus down and selected REFRESH, this then
loaded the page correctly. Note: Trying to refresh the page programmatically
using WebBrowser.Refresh() didn't work.
So, the work around for me was to use WebBrowser.DocumentText everywhere
except where it failed, and there use WebBrowser.Navigate().
Regards,
Rob
"Zhi-Xin Ye [MSFT]" <v-zhye@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:S$qBq43FJHA.1528@xxxxxxxxxxxxxxxxxxxxxxxxx
Dear Rob,
Do you mean the WebBrowser which uses a temporary file works fine now?
It's
OK for you, but would you like to share your workaround here? I think it
can benefit the community.
Sincerely,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx
This posting is provided "AS IS" with no warranties, and confers no
rights.
.
- References:
- WebBrowser not displaying page in Mobile application
- From: Rob
- RE: WebBrowser not displaying page in Mobile application
- From: Zhi-Xin Ye [MSFT]
- Re: WebBrowser not displaying page in Mobile application
- From: Rob
- WebBrowser not displaying page in Mobile application
- Prev by Date: RE: Exception Handling Block not writing to Vista Event Log
- Next by Date: RE: Extracting Coverage data from MSTest run with coverage enabled
- Previous by thread: Re: WebBrowser not displaying page in Mobile application
- Next by thread: messages going into deleted box
- Index(es):
Relevant Pages
|