Client side IFRAME - Postback

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

Hi

I have client side script that inserts an IFrame into a table cell upon a
particular client side click event. My problem is that when a postback
occurs, that IFrame "disappears". what do i do to work around this??

Thanks
Jason
 
During postback, you can check for some input and the create iframe in
codebehind. For creating iframe check out this example

System.Web.UI.HtmlControls.HtmlGenericControl iframe = new
HtmlGenericControl("iframe");
iframe.Attributes.Add("src", "./yourpage.aspx");
iframe.Attributes.Add("width", "240px");
iframe.Attributes.Add("height", "200px");
iframe.Attributes.Add("frameborder", "0");
this.FindControl("Form1").Controls.Add(iframe);
 
Back
Top