Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

CurrentCulture question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
LushaM@gmail.com - 17 Sep 2007 18:56 GMT
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
Juan T. Llibre - 17 Sep 2007 19:18 GMT
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/
======================================
> Hi, all!
>
[quoted text clipped - 19 lines]
> Thanks,
> Ilya
LushaM@gmail.com - 17 Sep 2007 20:13 GMT
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
Juan T. Llibre - 17 Sep 2007 21:04 GMT
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/
======================================
> Thanx for your reply.
>
[quoted text clipped - 15 lines]
> Thanks,
> Ilya
LushaM@gmail.com - 17 Sep 2007 22:09 GMT
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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.