Viewing HTML Text String in Webbrowser Control without saving to a

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
 
H

Herfried K. Wagner [MVP]

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.
 
C

Charles Law

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
 
A

Atara

You can also try

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


Atara.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top