PC Review


Reply
Thread Tools Rate Thread

CurrentCulture question

 
 
LushaM@gmail.com
Guest
Posts: n/a
 
      17th Sep 2007
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

 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      17th Sep 2007
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.





Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espanol : http://asp.net.do/foros/
======================================
<(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> 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
>




 
Reply With Quote
 
LushaM@gmail.com
Guest
Posts: n/a
 
      17th Sep 2007
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

 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      17th Sep 2007
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





Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
======================================
<(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
LushaM@gmail.com
Guest
Posts: n/a
 
      17th Sep 2007
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CurrentCulture and CurrentUICulture Tony Johansson Microsoft C# .NET 3 27th Mar 2010 07:03 PM
Thread.CurrentCulture Peter Morris [Droopy eyes software] Microsoft Dot NET Compact Framework 5 17th May 2009 03:33 PM
How to change CurrentCulture? Serge Wautier Microsoft Dot NET Compact Framework 3 30th Sep 2008 11:36 AM
CurrentCulture or InvariantCulture? rk Microsoft VB .NET 1 16th Apr 2007 06:27 AM
CurrentCulture-question Torben Schulz Microsoft Dot NET Compact Framework 0 27th Nov 2006 09:31 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:52 AM.