load HTML into Microsoft Web Browser control

R

rosty

I am loading a page in the constructor of my form to the Microsoft Web
Browser component:
string URI = "http://some_address.org";
object flags = 0;
object targetframe = "";
object headers = "";
object post = "";
this.axWebBrowser1.Navigate(URI, ref flags,
ref targetframe, ref post, ref headers);

then i am able to create a IHTMLDocument, but i want to parse, modify and
the load it back

private void axWebBrowser1_DocumentComplete(object sender,
AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent e)
{
mshtml.IHTMLDocument2 HTMLDocument =
(IHTMLDocument2) axWebBrowser1.Document;
//i want to parse and modify HTMLDocument and load it back to
axWebBrowser1
}

didn't find anything on msdn about this

Any example on how to do it?

I also wrote a function that gets as input the URI and returns a string with
the HTML code of that page, then maybe i could load this string to the
axWebBrowser control, but how?

Would be very grateful for any kind of reply. Sorry for my English.
 
W

Wiktor Zychla

I also wrote a function that gets as input the URI and returns a string
with
the HTML code of that page, then maybe i could load this string to the
axWebBrowser control, but how?

there are a few possibilities, for example:

((mshtml.IHtmlDocument2)webBrowser.Document).write( new_html_content );

regards,
Wiktor Zychla
 
R

rosty

thank you, it is working!
Wiktor Zychla said:
there are a few possibilities, for example:

((mshtml.IHtmlDocument2)webBrowser.Document).write( new_html_content );

regards,
Wiktor Zychla
 
M

Marc Scheuner [MVP ADSI]

Any example on how to do it?

Check out Tim Anderson's work on how to use the HTML control for
editing, in C#:

http://www.itwriting.com/htmleditor/index.php

Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 

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