Re: WebBrowser not displaying page in Mobile application



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.



.



Relevant Pages

  • Re: Any XML expert..?help.....
    ... > in XML.so when u open the xml file by using Internet Explorer, ... > this is a html code that imported varible from xml to html code and ... > display in Internet Explorer.... ...
    (comp.programming)
  • Re: Port 119 blocked at work and I want it opened
    ... | doesn't your distrust in MS is at such a low level that your only solution ... simply alter the display, rather than actually nix HTML code in the message. ... I can see the HTML code in plain text. ...
    (comp.security.firewalls)
  • Re: 96 DPI /120 DPI conflict - a possible solution
    ... having some problems displaying our new website on different PC's I ... our website to display properly on 120DPI widescreen laptops. ... disappeared in Firefox. ... after a bit of playing around with the HTML code (which I'm ...
    (microsoft.public.publisher.webdesign)
  • Re: intranet page not viewable
    ... The page is basic HTML code. ... > Security setting to low but the page still does not display. ... When I point my browser to the local HTML file the page will ...
    (microsoft.public.windows.inetexplorer.ie6.ieak)
  • & and &amp;
    ... We have a textarea in our system wehre a user can type in some html code ... others - is there a way of "escaping" the value before display? ...
    (comp.infosystems.www.authoring.html)