Localizing your website

BluJag

Perch
In the UK today is 19/9/05 where as in the US today is 9/19/05

So, to get your dates looking right for the user put this code in your Global.aspx.vb file

Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
' Fires at the beginning of each request
Try
If Request.UserLanguages.Length > 0 Then
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Request.UserLanguages(0))
End If
Catch ex As Exception


End Try
End Sub

This will stop people being confused about dates - very useful for e-commerce sites when send out your order despatched emails !!
 
dont forget to specify what language stuff is in :p

could be some C# people out there... or people who just dont know the difference!
 
Back
Top