473,609 Members | 2,187 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 8127
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
2027
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
45493
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 parent.document.funcname(), top.document.funcname(), and various other identifying methods, but all result in the above...
5
2252
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 to do this using Page.Parent I get null exception :( Here's a piece of code //master.aspx
6
9371
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
11159
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
18275
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
43533
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 solve this widdle.
10
1798
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
1363
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 continue which reloads the IFrame to page 2 of a total of 4. Each time the Iframe page changes the main...
0
8109
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8035
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8509
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8188
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
6969
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5502
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4059
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1630
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1366
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.