.NET FAQs Unleashed!
Skip Navigation Links
Interview questions on Design Patterns in .NET
ASP.NET Ajax Interview Questions
Interview questions related to security
C# Interview Questions
ASP.NET Interview Questions
Interview Questions in ASP.NET 2.0
Articles at dotnetuncle.com
Skip Navigation Links
OOPs questions in .NET
Questions on .NET Framework
ADO.NET Interview Questions
Short Answer questions in .NET
Frequently asked differences in .NET
Important commonly used Acronyms in .NET
MS SQL, Oracle SQL Interview Questions
 
    
Dotnetuncle's Tip:

  In order to compile a C Sharp program, you may use Visual Studio or may directly the csc.exe compiler

    

How to store information about a user's locale in ASP.NET? What is localization?

Localization is the feature of ASP.NET through which an application may be localized for a specific location. There are built-in mechanisms in .NET to allow localization process. The concept of localization is achieved in .NET as .NET is based on Unicode, thus it allows multiple characters of regions across the globe to be sent across in applications.

In .NET, the concept of localization is achieved using the System.Globalization namespace. A class named CultureInfo is used to localize .NET objects in the web applications. The functions provided in the globalization namespace work in tandem with the browswer's culture encoding properties. In order to set the culture encoding of a web application, changes may simply be done in the web.config file.

<configuration>
  <system.web>
   <globalization
   requestencoding="utf-8"
   responseencoding=" utf-8"
   fileencoding=" utf-8"
   culture="hi-IN"
   uiculture="en" />
 </system.web>
</configuration>

Here, the default culture is set to Hindi (hi-IN). However, the rest of the web application will use UTF8 character encoding. The default UI culture is "en" by default. Now in order to render different locality specific characters for different locations, different folders with their own Web.config files are created. Each of this folder will cater to a location. Note that in ASP.NET, a web.config file is allowed on any folder, this web.config file will override any settings provided in the web.config of any of its parent folder.

This is how locale specific directories are created for a site. Further note that culture settings may be set at page level as well. This is done using the @Page directive by setting its culture attribute to the desired culture.

<%@ Page Culture="hi-IN" UICulture="hi" ResponseEncoding="utf-8"%>

Instances of the CultureInfo class may also be created in code, to set the culture of a page through code.

Page Redirection  Values Between Pages  Worker Process  Page Life Cycle  Global Variables  Postback  Server Control  Viewstate  Send Email  Namespace  Localization  Event Handler  Validation  Global.asax  HttpHandler  Session  Cookie  EnableViewState  Smart Navigation  Web Farm  Dataset  Register 


    
Dotnetuncle's Tip:

  XmlReader is class meant for reading XML data in a forward-only manner. This means that the reading starts from the beginning of the XML data, and reading goes on till the end. It is instantiated using the XmlReader.Create method.