Last post Nov 18, 2014 04:52 AM by RobFra
Nov 17, 2014 04:01 AM|RobFra|LINK
I have resource files to take localized strings. it works perfectly inside all the website but it doesn't work inside the <WebMethod> defined on aspx page.
If I ask for CultureInfo.CurrentCulture.DisplayName, it shows the right culture set but trying to get a string from Resources.Dictionary.MyString, it shows always the string in the default resx file instead of localized resx file.
Nov 17, 2014 04:39 AM|PatriceSc|LINK
What if you try CultureUICulture instead? Does it use the correct value?
Nov 18, 2014 04:52 AM|RobFra|LINK
Hi and thanks for reply.
yes, I've fount that I have to set as first instruction of the <WebMethod>:
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture
It this way it seems to work, but really I don't know why....