create iframe and set content code example
Example 1: iframe with html string
<iframe srcdoc="<html><body>Hello, <b>world</b>.</body></html>"></iframe>
Example 2: iframe set html content c#
protected void btnChange_Click(object sender, EventArgs e)
{
myIframe.Attributes["srcdoc"] = "<h1>Contents Changed</h1>";
}