473,490 Members | 2,488 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

CultureInfo and Web.Config

I'd like to change the "CultureInfo" of my site.
Which instruction I have to put in the 'web.config' ?
any ideas?
tnx ;)

Sep 12 '06 #1
4 7471
Hi,

RicercatoreSbadato wrote:
I'd like to change the "CultureInfo" of my site.
Which instruction I have to put in the 'web.config' ?
any ideas?
tnx ;)
In web.config:

<globalization
requestEncoding="iso-8859-1"
responseEncoding="iso-8859-1"
culture="en-GB"
uiCulture="en-GB"
/>

In code-behind:

System.Threading.Thread.CurrentThread.CurrentCultu re
= new System.Globalization.CultureInfo( "en-GB" );
System.Threading.Thread.CurrentThread.CurrentUICul ture
= new System.Globalization.CultureInfo( "en-GB" );

Note: This affects the culture of the current thread only. Since each
request runs in a different thread, you must set it for each request
separately (i.e. in the Page's OnInit for example).

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Sep 12 '06 #2
I odn't understand. I've to modify both the web.config and the code
behind? I'd like to modify only the web.config.. is it right ?

Sep 12 '06 #3
He offered you a *choice*.
You can do one or the other...or both if you need to.

You can modify it in web.config *and* you can modify it it code.
Your choice...or both if you need to.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"RicercatoreSbadato" <em***********@yahoo.itwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
>I odn't understand. I've to modify both the web.config and the code
behind? I'd like to modify only the web.config.. is it right ?

Sep 12 '06 #4
Hi,

Juan T. Llibre wrote:
He offered you a *choice*.
You can do one or the other...or both if you need to.

You can modify it in web.config *and* you can modify it it code.
Your choice...or both if you need to.
That's correct, and sorry that I wasn't clear.

Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Sep 12 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6280
by: choyk1 | last post by:
Hi all, I cannot serialize CultureInfo property as below. It invokes InvalidOperationException. public class One { private CultureInfo culture;
0
1074
by: Maileen | last post by:
Hi, I wrote in VB a small application which save old culture info before to change them for running Excel macro. It looks like that : Dim oldCI As System.Globalization.CultureInfo = _...
1
1899
by: rerdavies | last post by:
OS: WIndows Server 2003. Currently logged in user is running with German(German) regional settings. Code fragment: System.Globalization.CultureInfo culture = new...
1
1100
by: Neo | last post by:
The short date format of my computer is dd/mm/yyyy and I get the same short date format when running other program. But the asp.net web page showed the short date format is m/d/y. Why...
1
1459
by: Cammie Watson | last post by:
We have two web servers that seem identical, regional settings etc. Although 1 does not run our app correctly, causing a "CAST to date" error to return from the SQL server (which both access) ...
3
1718
by: Cammie Watson | last post by:
We have 2 web servers that seem identical, the same version of 2 applications are installed (Web / Windows), they utilize the same SQL server and have the same regional settings. However, Server...
1
994
by: SMG | last post by:
Hi All, Can I put the culture information at a single place like some setting in config file, and just use it on every page where ever I require it. i.e. Just create the date object and...
4
6215
by: Dirk Behnke | last post by:
How can I start a new process with a different CultureInfo? I have tried already to set the CultureInfo of the thread starting the new process before creating the Process object, but it doesn't...
8
2810
by: Phil Jollans | last post by:
Hi, I am having difficulty overriding the ToString() method of CultureInfo using Visual Studio 2005. Exactly the same code works fine with Visual Studio .NET 2003. What I am doing is adding...
0
7108
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7181
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6847
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5445
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4875
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1383
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.