Viewing HTML stored in a variable...?

B2Ben

Well-known member
Joined
Aug 17, 2006
Messages
52
Programming Experience
Beginner
I would like to create a report after running a serties of operations, and I would like to write that report in HTML. However, I don't really need/want to save the file to the hard drive.

Can I write HTML data to a variable, and view it in some sort of browser control? I've never worked with web browser controls yet...

Any tips would be appreciated.

Thanks!
 
.Net 2.0 includes the WebBrowser control, just add one to the form. Before you can write to it you need to navigate somewhere because if not the document will be null-reference (and can't be created otherwise as I know of), navigating to standard empty page with "about:blank" url suits fine. Example:
VB.NET:
WebBrowser1.Navigate("about:blank")
WebBrowser1.Document.Write("<b>hello browser!</b>")
What is written by wb.Document.Write method replaces all current content in document.
 
Back
Top