473,406 Members | 2,293 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,406 software developers and data experts.

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 8115
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.aspx" 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.Attributes.Add("onclick", "HideFrame();");

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

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

HTH,
"Angel" <An***@discussions.microsoft.com> wrote in message
news:1D**********************************@microsof t.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
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...
26
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...
5
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...
6
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...
9
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...
14
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
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. ...
10
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....
0
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...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.