views:

15

answers:

2

Hello, I am using VB .NET 4.0, ISS 7.0. I wondered how can I set the default locale for all applications?

The problem is rising when I have a Response.Write(str) the numbers appear with ","(german notation) rather than "."(us notation).

From where .NET knows that he need to use the german locale?

In every my js script I have added

 Session.LCID = 3081;//  to fix the ,->.

but this is the brute force solution to fix the problem. Are there more elegant way to configure the server/.NET?

thanks
Arman.

A: 

You need to use the CultureInfo in the Numeric Format options:

123.456 ("C", fr-FR) -> 123,46 €

for example

ChrisF
+1  A: 

You can set the locale in your app.config

Just add

<configuration>
<system.web>
<globalization culture="CULTUREHERE, for example de-DE" />
</system.web>
</configuration>

Alternatively, you can change the culture your application thread uses at startup by setting the Current Culture:

Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE", false); 
samy
Thanks!! I am just using now: <globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US" uiCulture="en-US" />
Arman