CurrentCulture question

L

LushaM

Hi, all!

I have a question about CurrentCulture
( System.Globalization.CultureInfo.CurrentCulture ). As I understand,
by default, System.Globalization.CultureInfo.CurrentCulture has the
same settings (currency, date, spearators,..) as these that we can see
and edit from Control Panel -> Regional and Language Options.

It is true, when I use CurrentCulture in Console application in .Net
1.1.
But when I use it in ASP.Net Web Application 1.1 CurrentCulture
settings differs from "Regional and Language Options".

I looked web.config and machine.config - globalization section has
default attributes:
<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>

In ASP.Net 2.0 everything is correct.

Can anyone help me?

Thanks,
Ilya
 
J

Juan T. Llibre

Encoding has nothing to do with culture.

Try setting :

<globalization culture="xx-XX" uiCulture="xx-XX" />

....in web.config.

Substitute the culture you want for "xx-XX"...

See : http://asp.net.do/test/culture3.aspx
for a sample which sets current culture and iuCulture correctly.

If that answers your question, I'll be happy to post the source code for that page.
 
L

LushaM

Thanx for your reply.

I know how to set some predefined culture with
<globalization culture="xx-XX" uiCulture="xx-XX" />
...in web.config.

I need to get settings that user can see and change from Control Panel
-> Regional and Language Options.
For example user can select "Russian" in Regional options and through
Customize button user can change the currency symbol from rouble
(default for Russian culture) to dollar, for exapmle.

I need to get these customized settings.

In Console application .NET 1.1 or ASP.NET 2.0 Web application
System.Globalization.CultureInfo.CurrentCulture works fine for this.

Thanks,
Ilya
 
J

Juan T. Llibre

re:
!> I need to get settings that user can see and change from Control Panel

You don't need to change Windows' Regional and Language Options
in order for ASP.NET applications to be able to display regional options.

Did you see the functionality you are seeking in the sample link I posted ?

http://asp.net.do/test/culture3.aspx
 
L

LushaM

I understand your sample, but I need slightly different functionality:

As I understand, in your sample when I choose Danish-Denmark, you load
"da-DK" culture (i.e. format string with this culture) with all
default values for this ("da-DK") culture ( currencySymbol = "kr", for
example).

I'll try to explain what I want to get:
In Control Panel -> Regional and Language Options user selects Danish
culture. Than he or she clicks Customize and selects dollar ($) as
currencySymbol.
So, he gets a modified "da-DK" culture.

My goal is to get this *modified* "da-DK" culture when I start my
application: currencySign = '$', all other params the same with "da-
DK" culture.

In Console application .NET 1.1 or ASP.NET 2.0 Web application
System.Globalization.CultureInfo.CurrentCulture works fine for this.

Thanks,
Ilya
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top