culture

How do you implement a culture-specific address form using ASP.NET MVC?

We currently have a WebForms control with an update panel. The code-behind contains logic to show/hide fields based on the selected country. This is fine for WebForms, but we ware moving to MVC, and I'm having a hard time sorting this out. I also need this to be localized, both in terms of localizable resource strings as well as displayi...

Date.js culture info is confusing me

I'm including date.js (from datejs.com) and the en-IE culture info script. If I call alert(Date.CultureInfo.dateElementOrder) I see the correct dmy, but if I try to interpret the date 02/03/01 I get 3 Jan 2001 and not 2 Feb 2001. I'm not sure whether this is a bug in date.js or a problem with me. ...

How to create a DateTime object not in the current culture

I'm really drawing a blank on this one. I've been working on globalization but the DateTime seems to always revert back to the CurrentThread's culture. I broke this down into smaller steps hoping to find my issue, but it's starting to drive me crazy. I've got a textbox with the date expressed as a string: // the CurrentThre...

How can I change resource files for a c# winform app, without changing the culture?

We have a winform app that has been in development for some time. It has serveral images and control colours that create a branded experience. We have a second customer who would like the same product, but with different branding. So we have lines of code in the control designer.cs files like: this.BackgroundImage = global::MyNameS...

Calling ASP.NET WebService with variant culture decimal

I am calling a webservice using jQuery. The called method has a parameter of type decimal. My site change culture based what user choices. Before call webservice I use CompareValidator to validate, it do the right job, considering ThreadCulture. I can use CompareValidator to convert my string to invariant at javascript? Because webse...

How to prevent Thread.CurrentThread.CurrentCulture to switch to the default browser value after setting it manually?

In my current application I want to implement ASP.Net localization with global resources. I have the problem, that after changing the CurrentThread.CurrentUICulture and CurrentThread.CurrentCulture and changing to another page, these values are overwritten by the browser default values. I have a DropDownList that enables a selection bet...

How do i convert a floating point string to an int in c#

I have a string: string test = "19,95"; and I wan't to convert it to an int. I use: int num = Convert.Int32(test); However it throws an FormatException. And tells me that the string is not a proper string for conversion. My guess is that it has to do with the decimal seperator. How do i work around this? ...

read current culture of asp.net mvc project and change language in javascript confirm

I have a javascript confirm. My text is in english, but if I will change language/culture of my asp.net mvc project confirm is of cource still english. I can controll it manually and just write two javascript methods (for both Languages) but it is no so clean I think. And if I will have more than 3 languages its will be more dirty. Co...

How to force Visual Studio to sort files in Solution Explorer using culture-invariant sort

Hello, VS uses culture-variant sort for sorting files in the Solution Explorer -> in Czech, the 'Ch' digram is sorted between 'h' and 'i', and this behavior confuses me (I'd like to have my 'checkUser.aspx' files sorted next to 'createUser.aspx'). Is there any way how to achieve this, or VS just gets it's configuration from OS? ...

ASP.NET reset thread culture after use?

If I set Thread Culture and UICulture for one ASPX, after pass for that page, all my aspx that use the same thread(not same request) will have the same Culture? Because I need to set Culture just for one ASMX ...

CompareValidator currency check does not work with French formatted numbers

I have a salary TextBox and an associated CompareValidator, which is setup as follows: <asp:CompareValidator ... Operator="DataTypeCheck" Type="Currency" /> I fill the TextBox with a formatted string out of the database: txtSalary.Text = myObject.Salary.ToString("N2") When a user accesses the page using a French culture (such as fr...

Can you make sure all threads are started with a specific culture?

In my windows service, Spring.NET creates some threads handling jobs. Is it possible to make sure all these threads are started with a specific culture? Or do I have to set the culture in each thread? In ASP.NET, you can set the culture (globalization tag in web.config) at application level... can this be done in Windows Forms/Windows S...

OleDB Read Excel decimal value

I am using OleDB Ace 12 to read an Excel (xslx) sheet containing a column with decimal values. When I open the Excel sheet on my PC a decimal value is correctly formatted as 1.850,50 (NLD culture with comma as decimal separator) When I'm reading out the Excel sheet using OleDB (C#4.0), the string value of this field is always 1,850.50 (...

.net MVC culture

What's the best approach to develop multilanguage MVC web application?. What I envision is having a drop down with several language preferences on the master page. Selecting the language option would change the site's language/culuture. The site would also use a different suffix for each language option. for example selecting a languag...

.NET Globalization: Set Culture/UICulture on a Page or a Thread? What's the difference?

Question title is basically the entire question. In ASP.NET you can set the Culture/UICulture properties of a page by overriding the InitializeCulture method, or you can set the properties of the current thread. What are the differences? What are the advantages/disadvantages of both? What situations would you use each option? ...

How to convert en-gb to en-us (Arithmetic overflow error converting expression to data type datetime)

Arithmetic overflow error converting expression to data type datetime. The statement has been terminated. The culture of my site is en-gb (18/10/2010) The culture of my db server is en-us (10/18/2010) the date is stored in a param; command.Parameters.AddWithValue("@bookingdate", inputBookingDate.Text) Is there a way to convert this...

Help getting GB - US date conversions working in asp.net vb

My site is set to en-GB in the web.config. I have a calendar extended textbox control on a page which lets the user select date, in GB format as string (DD/MM/YYYY). I need to convert this to a US datetime before inserting into db. solution: (MM/dd/yyyy hh:mm:ss) I do hate mondays. Overthinking as usual. ...

Problem with loading culture from XML using CultureAndRegionInfoBuilder on Windows XP

Hi, I have a web application that will use a few different cultures, one of which is es-US (Spanish United States). However, Windows XP do not have any support for the culture es-US. To work around the problem, I've found out that one is supposed to be able to use the CultureAndRegionInfoBuilder. So I looked into CultureAndRegionInfoBui...

Asp.net export to csv and culture

I'm exporting data to a csv file using Asp.net and I need to know from the System.Globalization.CultureInfo.CurrentCulture if I should use "," or ";" as a value separator. For example US needs "," and Europe needs ";". How can I find out which one to use from the CurrentCulture? Thanks! ...

System for language versioning of .NET sites or Apps

Many years ago I build a simple system for handling languageversioning of texts in ASP.classic sites. Since then I have not converted or maintained it, and have been using various sub-optimal solutions (and lets face it, the system was probably not as great as I remember it ;-) What do you use for language versioning texts for your site...