Reputation: 1572
I have a database which has stored HTML code sources for different articles which are not in similar HTML design pattern. I want to display these codes in windows form application control e.g WebBrowser control so that it can be displayed in its original HTMLdesign style as if in the browser.But i hope if this process doesn't include creating html files on hard drive to read from it and i wish if there is a way to make the WebBrowser control navigate from objects created in the memory not created on hard drive .. For example i wish if the code could be like this :
HTMLFile myfile = new HTML File (htmlcode);
webbrowser1.Navigate(myfile);
Upvotes: 1
Views: 3022
Reputation: 27359
You should be able to do this using the DocumentText
property of the WebBrowser
control.
For example:
webBrowser1.DocumentText = "<html><body><h1>This is a test</h1></body></html>";
See this post for more info: C# WebBrowser HTML with references to scripts and images
Upvotes: 3