Server Site Web Part IFrame Rendering

by Administrator 19. January 2013 18:02
Need an easy way to render an IFrame from the server ..

Check out this example:

protected override void Render(HtmlTextWriter writer)

string frame = "outputFrame";

writer.AddStyleAttribute("display", "inline");

writer.AddAttribute(HtmlTextWriterAttribute.Id, frame);

writer.AddAttribute(HtmlTextWriterAttribute.Name, frame);

writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");

writer.AddStyleAttribute(HtmlTextWriterStyle.Height, "100%");

writer.AddAttribute("frameBorder", "0");

writer.AddAttribute(HtmlTextWriterAttribute.Src, url);

writer.RenderBeginTag(HtmlTextWriterTag.Iframe);

writer.RenderEndTag();

base.Render(writer);

}

Tags:

Log in
Privacy Policy Terms and Conditions Copyright Relational Development