Setting up WebBrowser.DocumentText without navigation: about

When you set this property, the WebBrowser control automatically navigates to: empty url before loading the specified text. This means that the Navigating, Navigated, and DocumentCompleted events are raised when you set this property and the value of the Url property no longer makes sense.

https://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.documenttext(v=vs.110).aspx


Let's say I first want to download a local .html file using Browser.Url = new Uri(some filePath.html);

This HTML file contains links like <script src="../Content/Scripts/ThisView.js"></script>

It works well. Since the Url is installed.

Then I want to manipulate the document with HtmlAgilityPack

or w / e and download the new content with the installer DocumentText

without losing it Browser.Url

(so script links etc. will get corrupted).

Is there a way to get around this, or do I need to overlay links in the document as well?

+3
c # browser winforms


source to share


No one has answered this question yet

Check out similar questions:

2058
How do I get a consistent byte representation of strings in C # without manually specifying the encoding?
1786
How to create Excel file (.XLS and .XLSX) in C # without installing Microsoft Office?
900
What is the highest JavaScript integer value that can go without losing precision?
658
How to make browser navigate to url in JavaScript
8
C # Navigating to Anchors in WebBrowser Control
2
How to update DocumentText with another DocumentText
2
Provide the url of the custom HTML loaded in webbrowser
1
loading jQuery in webbrowser control from file system
0
WebBrowser control: how to rewrite URL property
0
Change content without redirection to something like: blank



All Articles
Loading...
X
Show
Funny
Dev
Pics