VanPetrol 0 Light Poster

My site allow you to switch between 3 langauges.
At the time I created it, I still went with iFrames, and due to the size of the site now, very hard to go back and change everything.
All works fine, until the user start using that darn "BACK" and "FORWARD" buttoms. It seems the parent page, and the child pages respond different to the clicking of these buttons.
So, if the user changed his language, and then click "BACK", the "main" page will show in one language, and the child page in another.
I made 4 simple html pages with a javascript that control the iframe's source to demonstrate you my problem. Unzip demo.rar and run parent.html. [NO....CANNOT ATTACH HERE.....SEE SAMPLE CODE AT BOTTOM] Switch the language, and then use back....see?
Of course, in my asp.net pages it goes a bit deeper. Clicking the language buttons set this:

System.Web.HttpContext.Current.Response.Cookies["lang"].Value  = lang;
System.Web.HttpContext.Current.Response.Cookies["lang"].Expires = DateTime.Now .AddDays(360);
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(lang);
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;

and I check the language in each page's (each of the about 20 child pages) load event.
But, once again, showing a page by clicking the back button, does not fire the load event at all...postback or de not. So it seems I got now way forcing the child page to check the parent's language when the Back and Next buttons are used.
ps: Noticed in firefox, clicking back and next does nothing. Better check in IE, will you?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  <title></title>
  <script type="text/javascript">
  function ChangeLang(lang)
  {
    topbox  = document.getElementById("body");
  topbox.src = lang + ".html";     
  
  if (lang=="en")
      document.getElementById("main").innerHTML  = "The parent and child should show in <b>ENGLISH</b>";
  else if (lang=="ja")
      document.getElementById("main").innerHTML  = "The parent and child should show in <b>JAPANESE</b>";
    else if (lang=="zh")
      document.getElementById("main").innerHTML  = "The parent and child should show in <b>CHINESE</b>";
  }
  </script>
  </head>
  <body>
  <table width="800">
    <tr>
      <td align="left" id="main">The parent and child should show in <b>ENGLISH</b></td>
      <td align="right">
        <a href="#" onclick="ChangeLang('en');">English</a>
        <a href="#" onclick="ChangeLang('ja');">Japanese</a>
        <a href="#" onclick="ChangeLang('zh');">Chinese</a>
      </td>
    <tr>
    <tr>
      <td colspan=2>
        <iframe src="en.html" name="body" id="body" width="800" >        
        </iframe></td>
    </tr>
  </table>
  </body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.