Localizing your website

Discussion in 'ASP.NET Code Snips' started by BluJag, Sep 19, 2005.

  1. BluJag

    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 !!
  2. doctorallia

    doctorallia Perch

    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!

Share This Page

JodoHost - 26,000 hosting end-users in 100 countries
Plesk Web Hosting
VPS Hosting
H-Sphere Web Hosting
Other Services