Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4253690
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:58:47+00:00 2026-05-21T04:58:47+00:00

I know how to apply Localization to a page by creating the resource file.

  • 0

I know how to apply Localization to a page by creating the resource file. but one thing is really hurting to my mind since few days is, How the UIculture is getting applied to a ASP.NET page in the background of the screen ?

The thoughts coming to mind is in the events of Page Life Cycle.
If yes, then in which event and how to test that?

Please clarify.
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T04:58:48+00:00Added an answer on May 21, 2026 at 4:58 am

    To set the culture and UI culture for an ASP.NET Web page declaratively

    To set the UI culture and culture for all pages, add a globalization section to the Web.config file, and then set the uiculture and culture attributes, as shown in the following example:

    <globalization uiculture="es" culture="es-MX" />
    

    To set the UI culture and culture for an individual page, set the Culture and UICulture attributes of the @ Page directive, as shown in the following example:

    <%@ Page UICulture="es" Culture="es-MX" %>
    

    To have ASP.NET set the UI culture and culture to the first language that is specified in the current browser settings, set UICulture and Culture to auto. Alternatively, you can set this value to auto:culture_info_name, where culture_info_name is a culture name. For a list of culture names, see CultureInfo. You can make this setting either in the @ Page directive or Web.config file.

    To set the culture and UI culture for an ASP.NET Web page programmatically

    1. Override the InitializeCulture method for the page.
    2. In the overridden method, determine which language and culture to set the page to.
      • Note: The InitializeCulture method is called very early in the page life cycle, before controls are created or properties are set for the page. Therefore, to read values that are passed to the page from controls, you must get them directly from the request using the Form collection.
    3. Set the UI culture and culture in one of the following ways:
      • Set the Culture and UICulture properties of the page to the language and culture string (for example, en-US). These properties are internal to the page, and can only be used in a page.
      • Set the CurrentUICulture and CurrentCulture properties of the current thread to the UI culture and culture, respectively. The CurrentUICulture property takes a language and culture information string. To set the CurrentCulture property, you create an instance of the CultureInfo class and call its CreateSpecificCulture method.

    C# code sample:

    protected override void InitializeCulture()
    {
        if (Request.Form["ListBox1"] != null)
        {
            String selectedLanguage = Request.Form["ListBox1"];
            UICulture = selectedLanguage ;
            Culture = selectedLanguage ;
    
            Thread.CurrentThread.CurrentCulture = 
                CultureInfo.CreateSpecificCulture(selectedLanguage);
            Thread.CurrentThread.CurrentUICulture = new 
                CultureInfo(selectedLanguage);
        }
        base.InitializeCulture();
    }
    

    See below for a detailed page lifecycle:

    1. Construct
    2. ProcessRequest
    3. FrameworkInitialize
    4. InitializeCulture
    5. If child controls are present
      1. AddParsedSubObject
      2. CreateControlCollection
      3. AddedControl
      4. ResolveAdapter
    6. DeterminePostBackMode
    7. OnPreInit
    8. OnInit
    9. TrackViewState
    10. OnInitComplete
    11. OnPreLoad
    12. OnLoad
    13. OnLoadComplete
    14. EnsureChildControls
      1. CreateChildControls
    15. OnPreRender
    16. OnPreRenderComplete
    17. SaveViewState
    18. OnSaveStateComplete
    19. CreateHtmlTextWriter
    20. RenderControl
    21. Render
      1. RenderChildren
      2. VerifyRenderingInServerForm
    22. OnUnload
    23. Dispose
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that you can apply CSS in order to style objects in Flex
Know of an OCAML/CAML IDE? Especially one that runs on Linux?
Does anyone know how to apply the ANTI_ALIAS_FLAG to ImageView 's in layouts rather
I know this question has been asked so many times before but I couldn't
I know it might not be according to Apple's human interface guidelines for the
Does anyone know what end user information a developer receives from Apple regarding a
I've incorporated Apple's Reachability sample into my own project so I know whether or
Can anybody help me out to know the possible reasons for which Apple store
Know of any good libraries for this? I did some searches and didn't come
I know in certain circumstances, such as long running processes, it is important to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.