Last post Sep 01, 2011 05:57 PM by Marquis_DeBlodey
Dec 03, 2010 10:32 AM|Marquis_DeBlodey|LINK
I can change the language of my site using a drop down list put I cant do it with buttons.
I have a button for each language. The user clicks on a button to choose their language.
The problem is that the "button click" code happens after the "Initialize Culture" Code.
So the language only changes after a page refresh.
I don't want to use parameters e.i.
I want to change the language through code.
If someone can solve this for me, I'll be real happy.
P.S. I'm using C#
Dec 04, 2010 04:07 AM|Mikesdotnetting|LINK
Check the value of each button in the Initialize culture code to see if one was clicked.
Dec 08, 2010 01:34 AM|sandy060583|LINK
Use Session variable, which can identify - In which culture the site is running.
So when u press button , in that click event of button change the session variable to that culture & based on Culture Session variable , you can set your culture using basepage or page init event..
Hope this will help !!!
Jan 14, 2011 12:15 PM|Marquis_DeBlodey|LINK
All those worked. Thanks.
Sep 01, 2011 05:57 PM|Marquis_DeBlodey|LINK
Ive come back to this thread to give one important feedback on what I've learned since I made multiligual sites.
If you want search engines to index all language versions of your site, you need to use the query string method.
If not, search engines will NOT index all languages on your site.
This is because search engines will only index an url once. So if a page is in french and english and both share the same url, withought a query string, you will only be able to index one version of that page.
With a query string, it is seen as a different page because it has a different url.
I put my french version with a lang=fr query string and put no query sting on english. This makes english my default language. All other languages have a query string.
If there is no query string, show the default language, if not, choose the language according to the "lang" query.
This solved my problem bieautifully. All my pages are now indexed.