473,574 Members | 3,142 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get IFrame Reference

How do I get the reference of the IFrame from the asp.net webpage that is
being displayed within that IFrame? In other words I have an IFrame in my
page. Within that IFrame Set the source to a different asp.net page. I want
on that page that is within the IFrame to be able to access the IFrame
object. How can that be done? Besides the reference to the IFrame but also
certain other objects that are in the Host page of the Iframe.

thanks in advance...
Nov 19 '05 #1
3 8126
No not at all. I do not want to do anything with changing the source. I need
to within the ASP.NET page that is within the IFrame to be able to Hide the
Iframe (which is the parent) when the User clicks a button. Thats it.... How
do I do this?

thanks

"Curt_C [MVP]" wrote:
If you want the page that's within the IFrame to be redirected just redirect
from that page... it will happen automatically and stay in the IFrame.
Now if you are saying you want the page that's inside the IFrame to redirect
the PARENT page you'll have to use Javascript to get the Parent ID.
Same from the Parent, to change the SRC for the IFrame.
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Angel" wrote:
How do I get the reference of the IFrame from the asp.net webpage that is
being displayed within that IFrame? In other words I have an IFrame in my
page. Within that IFrame Set the source to a different asp.net page. I want
on that page that is within the IFrame to be able to access the IFrame
object. How can that be done? Besides the reference to the IFrame but also
certain other objects that are in the Host page of the Iframe.

thanks in advance...

Nov 19 '05 #2
If you want the page that's within the IFrame to be redirected just redirect
from that page... it will happen automatically and stay in the IFrame.
Now if you are saying you want the page that's inside the IFrame to redirect
the PARENT page you'll have to use Javascript to get the Parent ID.
Same from the Parent, to change the SRC for the IFrame.
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Angel" wrote:
How do I get the reference of the IFrame from the asp.net webpage that is
being displayed within that IFrame? In other words I have an IFrame in my
page. Within that IFrame Set the source to a different asp.net page. I want
on that page that is within the IFrame to be able to access the IFrame
object. How can that be done? Besides the reference to the IFrame but also
certain other objects that are in the Host page of the Iframe.

thanks in advance...

Nov 19 '05 #3
Hi Angel,

If you want to hide the frame you should declare the frame as a server
control by adding a runat="server" attribute to the iframe control and
assign it an ID.

<iframe id="myFrame" runat="server" src="Default.as px" style="WIDTH:
616px; HEIGHT: 224px"></iframe>

On your page within the iFrame, you create a button (e.g. btnHideFrame)
which fires a client side event when clicked (this will hide the frame).

On your Page Load...
btnHideFrame.At tributes.Add("o nclick", "HideFrame();") ;

Then on your .aspx, add the codes below to handle the button's client-side
click event

<script>
function HideFrame()
{
window.parent.d ocument.all["myFrame"].style.display = "NONE";
}
</script>

HTH,
"Angel" <An***@discussi ons.microsoft.c om> wrote in message
news:1D******** *************** ***********@mic rosoft.com...
No not at all. I do not want to do anything with changing the source. I
need
to within the ASP.NET page that is within the IFrame to be able to Hide
the
Iframe (which is the parent) when the User clicks a button. Thats it....
How
do I do this?

thanks

"Curt_C [MVP]" wrote:
If you want the page that's within the IFrame to be redirected just
redirect
from that page... it will happen automatically and stay in the IFrame.
Now if you are saying you want the page that's inside the IFrame to
redirect
the PARENT page you'll have to use Javascript to get the Parent ID.
Same from the Parent, to change the SRC for the IFrame.
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Angel" wrote:
> How do I get the reference of the IFrame from the asp.net webpage that
> is
> being displayed within that IFrame? In other words I have an IFrame in
> my
> page. Within that IFrame Set the source to a different asp.net page. I
> want
> on that page that is within the IFrame to be able to access the IFrame
> object. How can that be done? Besides the reference to the IFrame but
> also
> certain other objects that are in the Host page of the Iframe.
>
> thanks in advance...

Nov 19 '05 #4

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

Similar topics

2
2025
by: DaveO | last post by:
Hi All. I have a web with the default startup page as : index.htm that contains an iFrame. The default page, that loads in the iFrame, when index.htm is loaded, is htmPage1.htm I want to be able hyperlink from a banner ad on a different site to show a different page in the iFrame when the index.htm page opens.
26
45490
by: Dave Hammond | last post by:
In document "A.html" I have defined a function and within the document body have included an IFRAME element who's source is document "B.html". In document "B.html" I am trying to call the function defined in "A.html", but every attempt results in an "is not a function" error. I have tried to invoke the function using...
5
2251
by: Grzesiek | last post by:
Hi! I have created page which contains some menu buttons and <iframe> with sub-page. Each menu action on the master web site should change content of iframe (by changing src attribute). But how to detect when user has opened subpage not in master's <iframe> ? Is it possible to obtain reference to master's page from sub-page ? When I'm trying...
6
9369
by: paul | last post by:
HI! How do we send a variable from an Iframe page back to its parent? I have a script that calculates the iframe's window size but I need to know how to send that value back to its parent so I can use it there. Thanks in advance :) Paul
9
11156
by: aatcbbtccctc | last post by:
Hi folks I've googled for an answer to this, with no success. Can someone please jump in, and put me out of my misery! (I'm sure it's quite simple) I have an invisible IFRAME, and a visible DIV: <IFRAME id=myframe style="display:none" src="..." onload="ShowNews(this)"></IFRAME>
14
18272
by: Aaron Gray | last post by:
Hi, I want to access the properties of an IFrame but seem unable to get access to the IFrames document body. <html> <body> <iframe src="test.html" id="IFrame"></iframe> </body>
18
43531
by: Chris Ianson | last post by:
Hi geniuses (or is that genii, or genies) The challenge is as above really. I have a page with an iframe in it, and need to call a JS function in the *parent* page, *from* inside the iframe. (It's for Google Maps, but I won't bore you with the complexities of that, as it doesn't affect the question). Mochas kudos to anyone able to...
10
1794
by: karthickdevi | last post by:
Hi, I am calling an iframe from my parent document. In the parent document, i used the following script to get the value of the textfield present in the iframe. This doesn't seem to work in IE. Please advise. window.frames.document.getElementsByName('mytextfield').value
0
1362
by: mem | last post by:
Hello, I'm a novice at this and am trying to solve a problem reference IFrame. The following code is for a page I've created. It works well with two exceptions. The IFrame is an application hosted by a third party that has no problem with me framing their page. The problem is when the user reaches the end of the first IFame page and clicks...
0
7758
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8100
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8270
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7856
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8137
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6509
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5335
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1369
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.