0

I have two frames in my .NET app (frame1 and frame2). In frame2, I have a button to switch from one language to another one and it works fine within this frame -> postback is done, language is switched and page reloads in the other language. Problem is that there are localized buttons in my other frame (frame1) but they do not refresh. How and where should I trigger the refresh of frame1 ?

Sorry for maybe not being very clear, I'm still a newbie in frames...

user957479
  • 491
  • 1
  • 5
  • 20

1 Answers1

0

The idea is to call from the iframe the parent window, there a function reload the frames that the parent (main window) contains and refresh them.

For example you can have this function on top window, that contains the iframe, to handle the refresh on all iframes.

function ReloadRestFrames(ButNotMe)
{
    if(ButNotMe != 'iframe_a_id')
        document.getElementById('iframe_a_id').contentWindow.location.reload();

    if(ButNotMe != 'iframe_b_id')
        document.getElementById('iframe_b_id').contentWindow.location.reload(); 
}

Then from the frame that you make the post back you call it on load as:

parent.ReloadRestFrames("iframe_a_id");

and this make all iframes (except the one that make the call) on the same page to reload.

Related:
Calling a parent window function from an iframe
What's the best way to reload / refresh an iframe using JavaScript?
How to refresh an IFrame using Javascript?

Community
  • 1
  • 1
Aristos
  • 66,005
  • 16
  • 114
  • 150