By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,417 Members | 1,088 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,417 IT Pros & Developers. It's quick & easy.

how to display a web page (in windows application) from an html string ?

P: n/a
Hi,

i have some html string and i would like to display it like the web browser
does.

what is the best way to do it ?

Best Regards ,

Tiraman :-)
Nov 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
* "Tiraman" <ti*****@netvision.net.il> scripsit:
i have some html string and i would like to display it like the web browser
does.


Save it to disk and use the webbrowser control to load the file
('Navigate2' method):

311303 WebOCHostVB.exe Hosts the WebBrowser Control in Visual Basic .NET
<URL:http://support.microsoft.com/?id=311303>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 20 '05 #2

P: n/a
Thanks!

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eG*************@tk2msftngp13.phx.gbl...
* "Tiraman" <ti*****@netvision.net.il> scripsit:
i have some html string and i would like to display it like the web browser does.


Save it to disk and use the webbrowser control to load the file
('Navigate2' method):

311303 WebOCHostVB.exe Hosts the WebBrowser Control in Visual Basic .NET
<URL:http://support.microsoft.com/?id=311303>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 20 '05 #3

P: n/a
You don't even have to save it to disk if you navigate to a blank document
first.
Use the WebBrowser control as Herfried suggested except browse to
about:blank first. Then use the document.Write moehod of the webbrowser
control to add your html string. Don't worry if intellisense doesn't display
any methods.

Me.myBrowser.Navigate2("about:blank")
Me.myBrowser.Document.Write("<HTML><BODY>HELLO WORLD</BODY></HTML>")
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eG*************@tk2msftngp13.phx.gbl...
* "Tiraman" <ti*****@netvision.net.il> scripsit:
i have some html string and i would like to display it like the web
browser
does.


Save it to disk and use the webbrowser control to load the file
('Navigate2' method):

311303 WebOCHostVB.exe Hosts the WebBrowser Control in Visual Basic .NET
<URL:http://support.microsoft.com/?id=311303>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 20 '05 #4

P: n/a
Cool!

"Jared" <VB***********@email.com> wrote in message
news:10*************@corp.supernews.com...
You don't even have to save it to disk if you navigate to a blank document
first.
Use the WebBrowser control as Herfried suggested except browse to
about:blank first. Then use the document.Write moehod of the webbrowser
control to add your html string. Don't worry if intellisense doesn't display any methods.

Me.myBrowser.Navigate2("about:blank")
Me.myBrowser.Document.Write("<HTML><BODY>HELLO WORLD</BODY></HTML>")
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eG*************@tk2msftngp13.phx.gbl...
* "Tiraman" <ti*****@netvision.net.il> scripsit:
i have some html string and i would like to display it like the web
browser
does.


Save it to disk and use the webbrowser control to load the file
('Navigate2' method):

311303 WebOCHostVB.exe Hosts the WebBrowser Control in Visual Basic .NET
<URL:http://support.microsoft.com/?id=311303>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>


Nov 20 '05 #5

P: n/a
Hi.

I just found this post while having a similar problem. This solution
works for me also, *if I can also set the LocationURL property*. This is
because my string may have references to relative paths (for example
<form action="/someurl">). The hyperlink won't work unless the location
is the right one, or I make a method to replace all the relative paths
for absolute ones. Any suggestions?

TIA,
Manuel Ricca

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #6

P: n/a

You can use the html BASE tag with absolute path, and all other links
can stay relative.

Atara.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.