iframe set html content c#

C#
protected void btnChange_Click(object sender, EventArgs e)
{
    myIframe.Attributes["srcdoc"] = "<h1>Contents Changed</h1>";
}
Source

Also in C#: