locked
Globlization RRS feed

  • Question

  • User336489426 posted

    Hello everyone,

    I have globalization set in web.config as follows

    <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-IN" uiCulture="en-US"/>

    It works fine under local IIS but it reposts as error saying "The <globalization> tag contains an invalid value for the 'culture' attribute." 

    Please help me regarding this. Is it IIS version problem. I ran it on local IIS 7.0 but on the default domain I think it is IIS 6.0 If this is the case then how I can convert the same to be usable under IIS 7.0

    Thank you all.

    Wednesday, March 31, 2010 4:30 PM

Answers

  • User-1636183269 posted

    Protected Overloads Overrides Sub InitializeCulture()
            Dim objCultureInfo As New CultureInfo("en-IN")
            Thread.CurrentThread.CurrentUICulture = objCultureInfo

            Dim objDateTimeFormatInfo As DateTimeFormatInfo = objCultureInfo.DateTimeFormat
            objDateTimeFormatInfo.ShortDatePattern = "dd/MM/yy"
            objDateTimeFormatInfo.LongDatePattern = "dd/MM/yyyy"
            objCultureInfo.DateTimeFormat = objDateTimeFormatInfo
            objCultureInfo.NumberFormat.NumberGroupSeparator = ","
            objCultureInfo.NumberFormat.NumberDecimalSeparator = "."
            objCultureInfo.NumberFormat.NumberGroupSeparator = ","
            objCultureInfo.NumberFormat.CurrencyDecimalSeparator = "."
            objCultureInfo.NumberFormat.CurrencyGroupSeparator = ","
            objCultureInfo.NumberFormat.CurrencySymbol = "Rs"
            Thread.CurrentThread.CurrentCulture = objCultureInfo
            objDateTimeFormatInfo = Nothing
            objCultureInfo = Nothing
            MyBase.InitializeCulture()
        End Sub

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 5, 2010 1:02 PM

All replies

  • User-1636183269 posted

    <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-IN" uiCulture="en-US"/> 

    please change culture="en-US", it should be same

    <globalization
    requestEncoding="utf-8"
    responseEncoding="utf-8"
    culture="en-GB"
    uiCulture="en-GB"
    />

    Wednesday, March 31, 2010 11:20 PM
  • User336489426 posted

    Hello, thanks for help but problem still persists. When I use same value for culture and uiculture then it shows an error saying that The <globalization> tag contains an invalid value for the 'culture' attribute.

    My globalization declaration is

    <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-IN" uiCulture="en-IN"/>

    I changed the values for both attributes from en-IN to en-US then it is working fine, but I wanna use en-IN , so please tell me what is issue and how I can resolve it, on the local server it is working fine but on the remote server it is causing error.

    Thank you.


    Thursday, April 1, 2010 6:33 AM
  • User-1588418485 posted

    no such culture as en-IN

    Thursday, April 1, 2010 8:04 AM
  • User-1200560727 posted

    Can you please let us know that for which language you want to set culture?

    Because we can set culture = "en-US" for English, culture ="de-DE" for German, culture ="it-IT" for Italian etc.

    I hope now its clear to you.


    Thursday, April 1, 2010 9:13 AM
  • User336489426 posted

    Hi, but it was working under local server. If such culture is not there then why it did not raise any error when I was running site under local server and default web server that ships with Visual Studio.

    If there is any other solution to this please tell me that. I wanna show price in Indian rupees where price is followed by Rs. not by the $ sign.

    Thank you

    Thursday, April 1, 2010 9:13 AM
  • User-1636183269 posted

    EN-IN *** Information about a fully supported set of web services for India users is found at http://dev.mapindia.live.com/sdk.

    Not for others thats why you are facing problem refer below link

    http://msdn.microsoft.com/en-us/library/cc981048.aspx.

    Mark as answer if it helps.


    Friday, April 2, 2010 3:12 AM
  • User336489426 posted

    Hello,

    Can I get .dll file for en-IN culture from any where. I added ajax control toolkit where few of the cultures are viz. it, hi, es etc. 

    And the link you provided has listing for en-IN, so is it possible to have that .dll file and if yes then where I can get that. 

    Thank you and please reply.


    Friday, April 2, 2010 5:24 AM
  • User336489426 posted

    hello guys,

    please help me regarding this culture en-IN, alternatively how I format the price string so it shows the Rs. in front of the price. eg. Rs. 500 even when I just store 500 in the database. So please help me regarding this.

    I am using following code to format the string but without en-IN culture it will show $ in front of price eg. $500 , so please tell me that how I should format it so that it shows Rs.

    <asp:BoundField DataField="Price" HeaderText="Price" HtmlEncode="false" ReadOnly="True" SortExpression="Price"
          DataFormatString="{0:c}">

    thank you guys.


    Monday, April 5, 2010 10:32 AM
  • User-1636183269 posted

    Protected Overloads Overrides Sub InitializeCulture()
            Dim objCultureInfo As New CultureInfo("en-IN")
            Thread.CurrentThread.CurrentUICulture = objCultureInfo

            Dim objDateTimeFormatInfo As DateTimeFormatInfo = objCultureInfo.DateTimeFormat
            objDateTimeFormatInfo.ShortDatePattern = "dd/MM/yy"
            objDateTimeFormatInfo.LongDatePattern = "dd/MM/yyyy"
            objCultureInfo.DateTimeFormat = objDateTimeFormatInfo
            objCultureInfo.NumberFormat.NumberGroupSeparator = ","
            objCultureInfo.NumberFormat.NumberDecimalSeparator = "."
            objCultureInfo.NumberFormat.NumberGroupSeparator = ","
            objCultureInfo.NumberFormat.CurrencyDecimalSeparator = "."
            objCultureInfo.NumberFormat.CurrencyGroupSeparator = ","
            objCultureInfo.NumberFormat.CurrencySymbol = "Rs"
            Thread.CurrentThread.CurrentCulture = objCultureInfo
            objDateTimeFormatInfo = Nothing
            objCultureInfo = Nothing
            MyBase.InitializeCulture()
        End Sub

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 5, 2010 1:02 PM
  • User336489426 posted

    Hello,

    thanks for solution but pleasse tell me where I should put the code and under what event viz. page_load or something else. And then after putting code do I need to remove the format string from the line of code that I pasted in last post.

    please reply soon because I think it will definitely work

    thank you once again.



    Tuesday, April 6, 2010 6:17 AM
  • User-1636183269 posted

    create base page, go through below forum

    http://forums.asp.net/t/1514920.aspx


    Tuesday, April 6, 2010 6:20 AM
  • User336489426 posted

    Thank you Mr. sandeep.

    I used the same code as directed in your post and it is working fine

    Thank you for your kind help and Showing data in format that I wanted.

    Thank you once again.


    Sunday, April 11, 2010 4:24 AM
  • User-1636183269 posted

    It is my pleasure dear :) 

    Sunday, April 11, 2010 5:59 AM