0

I have a C# WPF application. In my UI I have a WebBrowser that is collapsed and will remain collapsed at all times. In my code behind I want to create an HTML document and load this document into the collapsed WebBrowser.

The only thing I can think of is writing my HTML as a string and then using File.Create() to create file and then using Browser.Navigate to navigate to that file.

The problem is though, I don't want to create any temp files on the computer or have to reference any file paths. Is there any way to create some kind of HTML file object in memory and then pass this object to the WebBrowser to be loaded?

1 Answer 1

1

You can use NavigateToString or NavigateToStream methods of WebBrowser control.

I suggest to you, Use navigateToString method. Just pass html text to method.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.