Viewing HTML Text String in Webbrowser Control without saving to a

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am attempting to view an HTML string in a hosted browser window (vb.net 03
+ ie6sp2)

I have something like this

dim strHTML as String = "<HTML>TEST</HTML>"

What I want to do is show that text in the control without having to save it
to a temp file first.

What I would like to do is something like:
AxWebBrowser1.Document.HTML = strHTML



thanks -Shadowboxer
 
shadowboxer said:
I have something like this

dim strHTML as String = "<HTML>TEST</HTML>"

What I want to do is show that text in the control without having to save
it
to a temp file first.

You can navigate to an "empty" dummy document and set
'Document.innerHTML' to the string containing the HTML code.
 
In fact, it doesn't even need to be a 'document'. Navigate to "about:blank"
for the same effect. In any case, this is correct initialisation procedure
for the control. Be sure to wait for readyState to return "complete" before
you continue.

HTH

Charles
 
You can also try

dim strHTML as String = "<HTML>TEST</HTML>"
dim strDoc as String = "javascript:document.write(" & strHTML & ")"
Me.myAxWebBrowser.Navigate(strDoc)


Atara.
 
Back
Top