Following code will help to detect the broswer language. Can be useful in situations when you want to display strings according to the browser language.
string browserLanguage = Request.UserLanguages[0];
Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(browserLanguage);
Label1.Text = Thread.CurrentThread.CurrentCulture.DisplayName;
It's not working on my side.
ReplyDeleteI am running VB 2010.
Error 8 'System.Globalization.CultureInfo.CreateSpecificCulture(string)' is a 'method' but is used like a 'type'
Error 6 The name 'Request' does not exist in the current context