locked
How to get the the culture value in the globalization node in web.config? RRS feed

  • Question

  • User1490168606 posted

    Hi, I need to get the the culture value in the globalization node in web.config to use it as in label control text instead of hadcode it as I do in the following label:

     

    <asp:Label ID="lblName" runat="server" Text="<%$ Resources:Eng, Namekey %>" />

    Tuesday, November 6, 2007 10:39 AM

Answers

  • User-1136466523 posted


    Hi,

    From your description, it seems that you want to bind the culture value in the globalization node in web.config, right?

    Actually, the code you provided seems like to bind a global resource you set in your application. So I’m wondering if are asking the Global resource, binding is one of the way, besides, you can access it in code behind like the following way:
    HttpContext.GetGlobalResourceObject("Eng", " NameKey")

    Anyway, if you still want to retrieve the settings in System.Web, you may refer the ConfigurationSectionCollection which can return the setting collections. For more information, see:

    http://msdn.microsoft.com/en-us/library/system.configuration.configurationsectioncollection.aspx

    Thanks.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 8, 2007 3:44 AM

All replies

  • User-503940700 posted

     Refer this article on how to implement the same in ASP.NET:

    http://www.codeproject.com/useritems/localization.asp

    HTH,

    Vivek 

    Wednesday, November 7, 2007 2:00 AM
  • User1490168606 posted
    that does not help.
    Wednesday, November 7, 2007 10:52 AM
  • User-1136466523 posted


    Hi,

    From your description, it seems that you want to bind the culture value in the globalization node in web.config, right?

    Actually, the code you provided seems like to bind a global resource you set in your application. So I’m wondering if are asking the Global resource, binding is one of the way, besides, you can access it in code behind like the following way:
    HttpContext.GetGlobalResourceObject("Eng", " NameKey")

    Anyway, if you still want to retrieve the settings in System.Web, you may refer the ConfigurationSectionCollection which can return the setting collections. For more information, see:

    http://msdn.microsoft.com/en-us/library/system.configuration.configurationsectioncollection.aspx

    Thanks.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 8, 2007 3:44 AM