Yes, another means is use a static black htm page and always let the iframe
point to that page whenever you want to make it display empty.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "Barrie Wilson" <>
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>Subject: Re: Clear IFRAME from code behind?
>Date: Wed, 14 Nov 2007 11:54:55 -0600
>
>"Peter Bromberg [C# MVP]" <> wrote in
message
>news:A5E0463F-7948-4469-950C-...
>> 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";
>
>
>