473,385 Members | 1,838 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 problem

Hello

I have an .aspx page that has an Iframe that embeds another .aspx page. In
the "embedded" .aspx page that is loaded, I have a button. When the user
clicks on the button, I do some control validation and a couple of
calculations. If all is OK I need to go to another .aspx page.

However, the problem I have is "busting out" of the embedded .aspx page so
that the new page is loaded over the "parent" .aspx page. I know that if
this were a hyperlink, I could simply use the target="_top" attribute. But
since I need a button to handle the validation code, I don't have that
available.

Has anyone had this problem before or know how to get around it?

TIA
Steve
Nov 19 '05 #1
3 1191
Remember, when your user clicks that button, he's really submitting a
form. ASP.NET just makes it appear to you (the developer) that you
have an event hooked up to that button. You can put a
targed="whatever" into your <form> tag and it should behave as you
want.

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/

Nov 19 '05 #2
Inject this in your IFrame page in the onload event for
pages you want busted out.

try
{
if (self.parent.frames.length != 0)
self.parent.location=document.location;
}
catch (Exception) {}

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.masterado.net

Earn $$$ money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp

"Steve Peterson" <sp*******@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello

I have an .aspx page that has an Iframe that embeds another .aspx page. In
the "embedded" .aspx page that is loaded, I have a button. When the user
clicks on the button, I do some control validation and a couple of
calculations. If all is OK I need to go to another .aspx page.

However, the problem I have is "busting out" of the embedded .aspx page so
that the new page is loaded over the "parent" .aspx page. I know that if
this were a hyperlink, I could simply use the target="_top" attribute. But
since I need a button to handle the validation code, I don't have that
available.

Has anyone had this problem before or know how to get around it?

TIA
Steve

Nov 19 '05 #3
Thx! Did the trick!
Steve

"Robbe Morris [C# MVP]" <in**@eggheadcafe.com> wrote in message
news:Oc**************@TK2MSFTNGP14.phx.gbl...
Inject this in your IFrame page in the onload event for
pages you want busted out.

try
{
if (self.parent.frames.length != 0)
self.parent.location=document.location;
}
catch (Exception) {}

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.masterado.net

Earn $$$ money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp

"Steve Peterson" <sp*******@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello

I have an .aspx page that has an Iframe that embeds another .aspx page.
In the "embedded" .aspx page that is loaded, I have a button. When the
user clicks on the button, I do some control validation and a couple of
calculations. If all is OK I need to go to another .aspx page.

However, the problem I have is "busting out" of the embedded .aspx page
so that the new page is loaded over the "parent" .aspx page. I know that
if this were a hyperlink, I could simply use the target="_top" attribute.
But since I need a button to handle the validation code, I don't have
that available.

Has anyone had this problem before or know how to get around it?

TIA
Steve


Nov 19 '05 #4

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

Similar topics

4
by: Thomas | last post by:
Hi there, I have an iframe which is editable (designMode = "on") and want to resize it dynamically as the content grows (e.g. more lines of text is in there) and there the struggle starts. I...
7
by: Christopher J. Hahn | last post by:
I'm trying to use a script-generated form to submit to a script-generated iframe. The problem I'm running into is that the iframe is not assuming the name I assign it. IE6 on Win2000. FF1.0.2+...
12
by: wangzx | last post by:
I am the author of easyajax.sourceforge.net, and I have a problem on Firefox 1.5, I post the problem here and hopes somebody help me. The test page can be:...
26
by: shlomi.schwartz | last post by:
using this example: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Test Page</title> </head>
1
by: jaktharkhan | last post by:
Hi, I really really need help in trying to figure out how can I do a CloneNode on an Iframe where the cloned IFRAME clones with all its contents?. Basically what I am doing is dynamically building...
7
by: nicknack | last post by:
Hi. I have a strange problem wuth IFRAME. I have page aaa.aspx with an IFRAME that contain page bbb.aspx. page bbb.aspx sometimes redirect him self to page ccc.aspx. The problem is that...
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: 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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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...
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...

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.