473,385 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

iframe in WebForm

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
Nov 16 '05 #1
2 3161
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.
"Luboš Šlapák" <lu**********@centrum.cz> wrote in message
news:uG**************@TK2MSFTNGP15.phx.gbl...
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

Nov 16 '05 #2
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.

--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Luboš Šlapák" <lu**********@centrum.cz> wrote in message
news:uG**************@TK2MSFTNGP15.phx.gbl...
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

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Luboš Šlapák | last post by:
I have iframe in webform and when I load a page into iframe, then i want go back on the previous page, which was in iframe before. How can I do it?
1
by: Luboš Šlapák | last post by:
I have iframe in webform and I load a page into iframe, then when I click on button on this page I want go back on the previous page, which was in iframe before. How can I do it?
4
by: L Anthony Johnson | last post by:
Has anyone had any success doing this. I have tried, but the InnerHTML property always comes back as an empty string. L Anthony Johnson
3
by: Peter | last post by:
I have a webform on this form is a User Control and another webform in IFRAME On the User Control there is a save button. I want to click this button and somehow tell the webpage in IFRAME that...
4
by: Nad | last post by:
Hello, When I click on a linkbutton of a datagrid on a web form I open another web form on the same page within an iframe. The page within the iframe has a datagrid also and when I click on a...
5
by: Chris Kennedy | last post by:
I want to put an Iframe on a webform page. How do I get the Iframe's source file to change at the press of button control on a web form (containing the iframe). Preferabaly without javascript,...
0
by: Brent.Lakatos | last post by:
ASP.NET 2.0 Question: I have a simple IFrame User Control that I wrote: HTML: <%@ Control Language="C#" AutoEventWireup="true" CodeFile="IFrameControl.ascx.cs" Inherits="IFrameControl" %> ...
2
by: rodchar | last post by:
hey all, let's say i have a single button on a page which is shown thru an iframe on my webform. if i press the button that's inside the iframe is there a way to write text to a textbox that's...
1
by: msxkim | last post by:
Hi all, I have a webpage with one iframe and a button. On Page Load event, if (!Page.IsPostBack) { string sDocUrl = //some doucmen url Iframe1.Attributes = sDocUrl; }
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.