Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 16, 2011 04:43 PM by Mamboking
Aug 14, 2011 11:11 AM|LINK
Hi all,I added to my website in vb.net a LocalResource with a translated content in .resx archives. The translation works properly based on the browser language but i want to change the language from the same page. For this I added the following code in the button event:System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("fr-FR")System.Threading.Thread.CurrentThread.CurrentUICulture = New System.Globalization.CultureInfo("fr-FR")System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo("fr")System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("fr") It does not work, the page stills with the same language.Anyone know how I can change it?
Thank you in advance.
Aug 14, 2011 11:27 AM|LINK
you have to set resources to your controls
Aug 16, 2011 06:13 AM|LINK
Please refer MSDN article about how to set the current UI culture and current culture
Hope this helps, thanks.
Aug 16, 2011 06:19 AM|LINK
The problem was that i can't put "Protected Overrides Sub InitializeCulture()" in the master page, therefore, i have to put initializeculture in all the aspx pages?
Aug 16, 2011 04:43 PM|LINK
You can do as follow:
1. Put button "Change language" to master page.
2. Put handler that get button event of master page to your .aspx page
3. Put in the handler you code for change culture.
I believe you easily can find sample of getting event from master page on asp.net learn chapters