iframe in WebForm

  • Thread starter Thread starter Lubo¹ ©lapák
  • Start date Start date
L

Lubo¹ ©lapák

Hi,
I have a WebForm and in this WebForm i have IFRAME with name="obsah".
How can I from C# code load a page into this IFRAME?

Thanks Lubos
 
1) Set the iframe tag to run at server.
2) Create a variable in the code-behind that is of HtmlGenericControl (or
something like that).
3) Use a method to create the @src attribute.
 
You need to specify the ID attribute for the iframe as well as
runat="server".
Then create an instance of
System.Web.UI.HtmlControls.HtmlGenericControl matching the ID that you
specified for the element.

Then, use
[INSTANCE].Attributes ["src"] = myURL;

Where myURL is the URL to the page you want to load.
 
Back
Top