Culture settings

  • Thread starter Thread starter EmJayEm
  • Start date Start date
E

EmJayEm

How do I change the culture settings of my aspx document written in vb.net
to UK English.

Thanks,
 
set the thread's CurrentCulture and CurrentUICulture to en-GB:

CultureInfo c = new CultureInfo("en-GB"); //creates a CultureInfo instance
for British English
System.Threading.Thread.CurrentThread.CurrentCulture = c; //Will
automatically format dates and such
System.Threading.Thread.CurrentThread.CurrentUICulture = c; //Used by the
ResourceManager to get the correct XML File

if you are creating a multilingual application, check out:

http://openmymind.net/localization/index.html
and
http://openmymind.net/localization/index2.html

Karl
 
Thanks but is code this in VB.net?


EmJ.


Karl Seguin said:
set the thread's CurrentCulture and CurrentUICulture to en-GB:

CultureInfo c = new CultureInfo("en-GB"); //creates a CultureInfo instance
for British English
System.Threading.Thread.CurrentThread.CurrentCulture = c; //Will
automatically format dates and such
System.Threading.Thread.CurrentThread.CurrentUICulture = c; //Used by the
ResourceManager to get the correct XML File

if you are creating a multilingual application, check out:

http://openmymind.net/localization/index.html
and
http://openmymind.net/localization/index2.html

Karl
 
Also what namespaces do I need?


Karl Seguin said:
set the thread's CurrentCulture and CurrentUICulture to en-GB:

CultureInfo c = new CultureInfo("en-GB"); //creates a CultureInfo instance
for British English
System.Threading.Thread.CurrentThread.CurrentCulture = c; //Will
automatically format dates and such
System.Threading.Thread.CurrentThread.CurrentUICulture = c; //Used by the
ResourceManager to get the correct XML File

if you are creating a multilingual application, check out:

http://openmymind.net/localization/index.html
and
http://openmymind.net/localization/index2.html

Karl
 
it isn't much different:

Dim c as new CultureInfo("en-GB")
System.Threading.Thread.CurrentThread.CurrentCulture = c
System.Threading.Thread.CurrentThread.CurrentUICulture = c


CultureInfo is found in System.Globalization.

Karl
 
I get the following error message:

Compiler Error Message: BC30188: Declaration expected.

Source Error:


Line 12:
Line 13: Dim c as new CultureInfo("en-GB")
Line 14: System.Threading.Thread.CurrentThread.CurrentCulture = c
Line 15: System.Threading.Thread.CurrentThread.CurrentUICulture = c
Line 16: I have included the system.Globalization namespace.

Can you help?


EmJ.
 
The error is on line 14.



EmJayEm said:
I get the following error message:

Compiler Error Message: BC30188: Declaration expected.

Source Error:


Line 12:
Line 13: Dim c as new CultureInfo("en-GB")
Line 14: System.Threading.Thread.CurrentThread.CurrentCulture = c
Line 15: System.Threading.Thread.CurrentThread.CurrentUICulture = c
Line 16: I have included the system.Globalization namespace.

Can you help?


EmJ.
 
I found an easier way is just to do this:

<%@ Page Language="VB" Culture="en-GB" %>

This changes the date validation to English format d/m/yyyy

Thanks,
 
Back
Top