Avatar of sybe
sybe
 asked on

How do you handle LCID issues in ASP.Net?

Just switched from Classic ASP to ASP.Net.

I am a bit lost in how to use to handle to LCID setting in ASP.Net. Most application I write are for a Dutch audience (LCID = 1043). On the other hand I don't want to have everything in Dutch while developing, because that also produces error messages in Dutch and those are quite useless when searching on error messages.

In Classic ASP (VBScript) I did often use the SetLocale function. The good thing of that is that it can be changed for every line of code. The SetLocale function seems not to be available in ASP.Net.

My question: how do you handle LCID issues in ASP.Net.

To be more concrete, in the following case:

The application sends an email. The email is in Dutch. The email contains date, which come from a database and need to be formatted with Dutch LCID (with the FormatDateTime() function). But - as I said - if there are any runtime errors on the page, I want to see them in US-EN.


ASP.NET

Avatar of undefined
Last Comment
sybe

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
AmarIs26

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
sybe

ASKER
Thanks. I was hoping for some input from more people, but since you have been the only one to answer, I'll accept your answer.

I am not so sure if it is handy to change the language of a page every time I see an error. The solution I found for setting LCID temporary to something is:

System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("nl-NL")
Your help has saved me hundreds of hours of internet surfing.
fblack61