Hy,
In my application I store a s开发者_如何学运维tring as content of a html file.
How can I preview this content (assuming that it's modified from original content) in browser but not having to save it local.
Update
And the preview to be in another tab or window.
You can create a preview page that just writes the html string to the response like so:
protected void Page_Load(object sender, EventArgs e)
{
string htmlString = //initialise the string here
Response.Write(htmlString);
Response.End();
}
Using the Control System.Windows.Forms.WebBrowser
, you can preview your HTML with DocumentText
Example:
webBrowser1.DocumentText = "<HTML><BODY style=\" background-color:black\"></BODY></HTML>";
精彩评论