Edit .NET Globalization Settings (IIS 7)
Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista
You can change globalization settings for ASP.NET applications at the Web server level when you want them to apply to all ASP.NET applications on the server. IIS lets you change the following globalization settings:
Culture settings, for example, the UI language
Encoding settings, for example, encoding for response headers
You can also edit ASP.NET globalization settings for sites, applications, directories, and files.
Note
Editing a configuration setting changes the setting at the local level and for any child levels that inherit the setting.
Prerequisites
For information about the levels at which you can perform this procedure, and the modules, handlers, and permissions that are required to perform this procedure, see NET Globalization Settings Feature Requirements (IIS 7).
Exceptions to feature requirements
- None
To edit .NET globalization settings
You can perform this procedure by using the user interface (UI), by running Appcmd.exe commands in a command-line window, by editing configuration files directly, or by writing WMI scripts.
Using the UI
Open IIS Manager and navigate to the level you want to manage. For information about opening IIS Manager, see Open IIS Manager (IIS 7). For information about navigating to locations in the UI, see Navigation in IIS Manager (IIS 7).
In Features View, double-click .NET Globalization.
On the .NET Globalization page, in the property sheet, click to select the global setting you want to edit, and select a value from the drop-down list.
In the Actions pane, click Apply.
Command Line
Edit default culture
To edit the default culture for processing Web requests, use the following syntax:
**Appcmd set config /commit:WEBROOT /section:globalization /culture:**string
The variable string is the default culture to be used for processing Web requests. For example, to change the default culture for processing Web requests to US English, type the following at the command prompt, and then press Enter:
appcmd set config /commit:WEBROOT /section:globalization /culture:en-us
Note
When you use Appcmd.exe to configure the <globalization> element at the global level in IIS 7, you must specify /commit:WEBROOT in the command so that configuration changes are made to the root Web.config file instead of ApplicationHost.config.
Enable or disable client-based culture
To enable or disable client-based culture, use the following syntax:
Appcmd set config /commit:WEBROOT /section:globalization /enableClientBasedCulture:True|False
The variable enableClientBasedCulture:True enables client-based culture and the variable enableClientBasedCulture:False disables client-based culture. The default is False.
Edit default culture for processing locale-dependent resource searches
To edit the default culture for processing locale-dependent resource searches, use the following syntax:
**Appcmd set config /commit:WEBROOT /section:globalization /uiCulture:**string
The variable string is the default culture to be used for processing locale-dependent resource searches.
Change default encoding
To change the default encoding when parsing .aspx, .asmx, and .asax files, use the following syntax:
**Appcmd set config /commit:WEBROOT /section:globalization /fileEncoding:**string
The variable string is the default encoding to be used when parsing .aspx, .asmx, and .asax files.
Edit assumed encoding for incoming requests
To edit the assumed encoding of each incoming request, use the following syntax:
**Appcmd set config /commit:WEBROOT /section:globalization /requestEncoding:**string
The variable string is the assumed encoding of each incoming request. The default is utf-8.
Change header encoding for responses
To change the header encoding for responses, use the following syntax:
**Appcmd set config /commit:WEBROOT /section:globalization /responseHeaderEncoding:**string
The variable string is the header encoding used for responses. The default is utf-8.
Edit content encoding for responses
To edit the content encoding for responses, use the following syntax:
**Appcmd set config /commit:WEBROOT /section:globalization /responseEncoding:**string
The variable string is the content encoding used for responses. The default is utf-8.
For more information about Appcmd.exe, see Appcmd.exe (IIS 7).
Configuration
The procedure in this topic affects the following configuration elements:
<globalization>
For more information about IIS 7 configuration, see IIS 7.0: IIS Settings Schema on MSDN.
WMI
Use the following WMI classes, methods, or properties to perform this procedure:
- GlobalizationSection class
For more information about WMI and IIS, see Windows Management Instrumentation (WMI) in IIS 7. For more information about the classes, methods, or properties associated with this procedure, see the IIS WMI Provider Reference on the MSDN site.