The easiest way to do this involves saving the content to a file, and
then having the webbrowser navigate to that file. The problem with this is
that any relative links in the document will be resolved with the file path
as the base url, and not the source where it came from.
If you need to resolve these links to the url that you downloaded the
content from, then you will need to do some work. I find that the easiest
way is to create an implementation of IMoniker, which will return the
contents through an IStream implementation. You can have your
GetDisplayName method of your implementation return the URL that the
document originally came from.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"ask josephsen" <jaj(((a)))oticon.dk> wrote in message
news:42**********************@news.dk.uu.net...
Hi NewsGroup
Hope you can help me with this. I'm using the
"System.Windows.Forms.WebBrowser" to display a various markuplanguage. And
it works fine pointing the "WebBrowser.Url" to a local or remote uri. But
what I would actually like to do, is to download a webpage as a string,
analyze it, possibly modify it, and then display it on the WebBrowser -
without asking the WebBrowser to download it again. By the
"HttpWebRequest" I can easily retrieve the textual webpage and I assume
you could replace the "WebBrowser.document" with a new
"Forms.HtmlDocument", made of the textual webpage just downloaded. But I
cant seem to make it work - how do I create a new HtmlDocument from a
string - that may or may not be wellformed!?
any tips most warmly welcomed
./ask