wakeup Posted March 21, 2005 Posted March 21, 2005 Do yout know if I can read regional and language options of client windows in asp.net? I need know decimal simbol. Thanks Quote
Administrators PlausiblyDamp Posted March 21, 2005 Administrators Posted March 21, 2005 You could always use Request.UserLanguages to see what languages the client supports. It should return an array of strings with position 0 being the default. Something like the following should work... Dim Language As String = Request.UserLanguages(0) If Not ((Language Is Nothing) OrElse (Language.IndexOf("-") < 0)) Then Dim ci As System.Globalization.CultureInfo = New System.Globalization.CultureInfo(Language) Dim CurrencySymbol As String = ci.NumberFormat.CurrencySymbol Label1.Text = CurrencySymbol End If you may want to loop through all provided languages to detect multiple currency characters - or at least loop till you find a valid one. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
wakeup Posted March 21, 2005 Author Posted March 21, 2005 Thanks but, if the user custimize the decimal format for their language it is no valid :( Quote
Administrators PlausiblyDamp Posted March 21, 2005 Administrators Posted March 21, 2005 In that case the easiest way is probably to either ask / offer a configuration section and store their selection somewhere. If the browser isn't configured correctly then you have no way of knowing their settings. This might just be possible if you used an ActiveX control on your web page - however this wouldn't work for any non-IE browser, non-windows platforms or if the user has quite sensibly decided to dis-allow ActiveX for security reasons. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.