•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 427,812 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,824 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 1194 | Replies: 0
•
•
Join Date: Oct 2006
Location: Beijing
Posts: 30
Reputation:
Rep Power: 2
Solved Threads: 0
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:
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?
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;
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>
If you want to use CSS to design Web sites you can't do it in a half-baked way. You are in or you're not in. - Charles Wyke-Smith
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
.net access activation ajax api asp blogger blogging blogs business software code combo custom dani daniweb data development dom dreamweaver dropdownlist erp systems gdata google gpl html key linux microsoft module net openbsd product programming project project management reuse rss serial skin software software selection tags technology evaluation theme vista web wysiwyg xml xoap
- I want to get started learning a programming language (Computer Science and Software Design)
- learning php (PHP)
- Lookup tables - how to perform a switch using a string (C++)
- Selection.End(xlDown).Select (Visual Basic 4 / 5 / 6)
- another "segmentation fault" (C++)
- Scroll Bars for the [Code][/Code] Tagged Portion (DaniWeb Community Feedback)
- what is python (Python)
- Forum lurkers, introduce yourself ... !! (Community Introductions)
- i need code for binary to decimal (it should be written in 'C') (C)
Other Threads in the ASP.NET Forum
- Previous Thread: User Controls not showing up in Mozilla Firefox
- Next Thread: separate dropdownlist for dates



Threaded Mode