G
Guest
I have a ASP.Net page with an IFrame control.
I need to make it empty from code behind.
Is it possible?
I need to make it empty from code behind.
Is it possible?
Peter Bromberg said:Declare a Generic control:
protected System.Web.UI.HtmlControls.HtmlGenericControl IFrame1;
Then, you need to do findcontrol to identify the control on the page and
typecast it:
HtmlControl IFrame1 = (HtmlControl)this.FindControl("IFrame1");
Now you can access the src property:
IFrame1.Attributes["src"] = http://www.live.com ;
From: "Barrie Wilson" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Subject: Re: Clear IFRAME from code behind?
Date: Wed, 14 Nov 2007 11:54:55 -0600
Declare a Generic control:
protected System.Web.UI.HtmlControls.HtmlGenericControl IFrame1;
Then, you need to do findcontrol to identify the control on the page and
typecast it:
HtmlControl IFrame1 = (HtmlControl)this.FindControl("IFrame1");
Now you can access the src property:
IFrame1.Attributes["src"] = http://www.live.com ;
but to "clear it" I believe it should be:
IFrame1.Attributes["src"] = "about:blank";
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.