Close an Iframe from within 2 ASPX Iframes

Asked

Viewed 395 times

0

I am in need of help to reload an iframe from within 2 iframes , already tried Parent.Document, Response.redirect, but does not occur what I request.

If I use Response.redirect(url), Iframe1 is reloaded within Iframe 3.

Se eu tento usar parent.document.getelementbyid ('iframe1') ou parent.document.getelementbyid ('iframe3') ou parent.document.getelementbyid ('<%=iframe1.ClientID.ClientID %>') ou parent.document.getelementbyid ('<%=iframe3.ClientID.ClientID %>'), é retornado nulo.

I’ve attached an image of what I’m trying to do.

I want when I click the button inside iframe3, iframe1 to be reloaded. inserir a descrição da imagem aqui

  • Ever tried to access two levels of "Parent"? Counting from the current open frame?

  • iframe from within 2 iframes! how is that? iframe 3 within iframe 2 that is within iframe 1 ?

  • yes, because the platform is old, this was the fastest way to solve the problem.

  • This way when iframe 1 is reloaded iframe 2 and iframe 3 will also be reloaded, so just put the button in iframe 1. But if you want to do this from within iframe 3 see the answer I posted.

2 answers

0


<script type="text/javascript">
<!--
function refresh(){
//pode referenciar qual frame, 0 1 2 ....
top.frames[0].location.reload();
}
//-->
</script>

<button onclick="refresh()">Refresh</button>
  • haha I did so and reloaded the whole page, not just iframe1.

  • You cannot NOT RELOAD iframes contained in iframe 1 if this iframe 1 is reloaded as the others are iframe 1 content

  • Leo, it’s okay to reload the iframes inside iframe1. The point is that this way recharges the entire page and not just iframe 1 and iframes within it, thus removing the open tabs within the platform.

  • I made it with top.frames[2].location.Reload(); and it worked too, thanks Leo.

0

I was able to do the following way Parent.Location='url', so I reloaded only iframe 1. Thank you all for the help.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.