Web.config File for ASP.Net Web Forms Globalization

Web Forms configuration files, named Web.config, provide settings for every Web Forms page in the same directory as the configuration file. The settings are usually also inherited by subdirectories. Each file can contain a globalization section in which you can specify default encodings and cultures. Values are valid if they are accepted by the related Encoding and CultureInfo classes. For more information on the contents of the Globalization section, see <globalization> Element. For general information on Web.config files, see ASP.NET Configuration.

<configuration>
<system.web>
<globalization
fileEncoding="utf-8"
requestEncoding="utf-8"
responseEncoding="utf-8"
culture="en-US"
uiCulture="de-DE"
/>
</system.web>
</configuration>

Web.config file :
  • Set the values of fileEncoding, requestEncoding and responseEncoding to specify the way in which .aspx files, request data and response data are encoded. For more information on encoding values, see Selecting an Encoding for Web Forms Globalization If the file encoding is specified in the Web.config file, the actual file must be saved in the same encoding. To select an encoding different from the system default, use the Advanced Save Options dialog box (available on the File menu).
  • Set the values of culture and uiCulture. For more information on culture values, see Setting the Culture and UI Culture for Web Forms Globalization.
Tags: , , ,
Hot on Web:


About author