Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. asp.net 2.0 master page

asp.net 2.0 master page

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdesigntutorialquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    oOomen
    wrote on last edited by
    #1

    hello all can anyone tell me how to se up CultureInfo and UICulture from master page(System.Web.UI.MasterPage)? thank u for ur advice

    M 1 Reply Last reply
    0
    • O oOomen

      hello all can anyone tell me how to se up CultureInfo and UICulture from master page(System.Web.UI.MasterPage)? thank u for ur advice

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi there, Basically, to set the CultureInfo and UICulture properties, you'll have the following options: + Set in the web.config file + Set in the Page directive (the Master directive does not support to set those attributes) + Set in code using the Thread.CurrentThread. So if you want to set the properties in the master page, you may consider using the last option. For more information, you can see the document: http://msdn2.microsoft.com/library/bz9tc508(en-us,vs.80).aspx[^]

      O 1 Reply Last reply
      0
      • M minhpc_bk

        Hi there, Basically, to set the CultureInfo and UICulture properties, you'll have the following options: + Set in the web.config file + Set in the Page directive (the Master directive does not support to set those attributes) + Set in code using the Thread.CurrentThread. So if you want to set the properties in the master page, you may consider using the last option. For more information, you can see the document: http://msdn2.microsoft.com/library/bz9tc508(en-us,vs.80).aspx[^]

        O Offline
        O Offline
        oOomen
        wrote on last edited by
        #3

        thank u for reply ok i'll describe my situation i have one master page for all aspx pages in my project. this master page has a dropdownlist control(postback is enabled) where users can pick up allowed languages. so i want to set up CultureInfo and UICulture during tha application is running. in the Page u can override some methods like InitializeCulture() to set up CultureInfo and UICulture or in Page_PreInit(), but master page has no access to this methods. only the one way i know is to override the method void Application_AcquireRequestState(Object sender, EventArgs e) in global.acax class in .netframework 1.1 i could use Session to save user language, but framework 2.0 do not have access to Session. so i have to use Cookie or userprofile but it does not look user friendly is any other possibilities to do that in master page?

        M 1 Reply Last reply
        0
        • O oOomen

          thank u for reply ok i'll describe my situation i have one master page for all aspx pages in my project. this master page has a dropdownlist control(postback is enabled) where users can pick up allowed languages. so i want to set up CultureInfo and UICulture during tha application is running. in the Page u can override some methods like InitializeCulture() to set up CultureInfo and UICulture or in Page_PreInit(), but master page has no access to this methods. only the one way i know is to override the method void Application_AcquireRequestState(Object sender, EventArgs e) in global.acax class in .netframework 1.1 i could use Session to save user language, but framework 2.0 do not have access to Session. so i have to use Cookie or userprofile but it does not look user friendly is any other possibilities to do that in master page?

          M Offline
          M Offline
          minhpc_bk
          wrote on last edited by
          #4

          Hi there, There are a couple of ways come to mind: + Because the language dropdownlist is placed in the master page, so you can place a snippet of code to set the CurrentCulture and CurrentUICulture of the Thread.CurrentThread in the Page_Load of the master page based on the selected language. And you need to remember that the code to display the culture-specific text on the web page should go after the culture-setting code. + You can save the selected culture of the user in the user profile[^], then you can set those properties in the overriden InitializeCulture method of the web page. + In the web page, you can access the selected value from the language dropdownlist in the master page and provide a snippet of code to set the culture info of the current thread. Just some ideas. There is also a good article[^] about the localization on the ASP.NET 2.0.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups