dotnetspider.com Home page     All Communities

DotNetInterviewQuestions&Answers


How culture can be set in ASP.Net application ?



My Profile 
  • Sign In
  •  
  • Register

  • Links 
  • Message Center
  •  
  • File Manager
  •  
  • Members
  •  
  • Hall Of Fame
  •  
  • Site Configuration





  • How culture can be set in ASP.Net application ?


    Posted Date: 09 Feb 2012      Total Responses: 1

    Posted By: priyanarayan       Member Level: Gold     Points: 30


    Culture can be specified in 3 ways:

    1)Declaratively : In the web.config file or in the @Page directive in the page, you can specify the culture as shown:
    web.config:
    <globalization uiCulture="es-MX" culture="en-US" />
    @Page Directive:
    <%@ Page UICulture="es-MX" Culture="es-MX" %>

    2)From the client browser's language setting :
    Here, the user can specify their language of choice through the Languages option in their browser.

    3)Programatically :
    In most cases, you will need to give an explicit way on your Web site for the user to select their language of choice. In such cases, you need to set the culture programmatically. Set these in the InitializeCulture method for the page.

    Thread.CurrentThread.CurrentCulture =
    CultureInfo.CreateSpecificCulture(selectedLanguage);
    Thread.CurrentThread.CurrentUICulture =
    new CultureInfo(selectedLanguage);




    Responses

    Author: Bhanupriya    14 May 2012Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2
    As I am a beginner in the field of ASP i am unable to understand...But i have a lot of interest to know more and more....


    Post Reply
    You must Sign In to post a response.
    Next : What is neutral Culture in the context of Globalization ?
    Return to Discussion Forum
    Post New Message
    Category:

    Related Messages