Public Class localizedPage
Protected Overloads Overrides Sub InitializeCulture()
Dim cCulture As String = ""
Dim objProfile As ProfileCommon = CType(HttpContext.Current.Profile, ProfileCommon)
If Not (objProfile.Language Is Nothing) Then
cCulture = objProfile.Language
End If
If cCulture.Length > 0 Then
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(cCulture)
System.Threading.Thread.CurrentThread.CurrentUICulture = New System.Globalization.CultureInfo(cCulture)
End If
MyBase.InitializeCulture()
End Sub
End Class
Errors:
1) sub initializeculture cannot be declared ovverrides because it does not override a sub in a base class
2) language is not a member of profilecommon
3) initializecluture is not a member of objects
lucasp
Member
100 Points
20 Posts
Re: declaring Protected Overrides Sub InitializeCulture() once for all
Mar 08, 2006 10:51 AM|LINK
Imports Microsoft.VisualBasic
Imports System.Threading
Imports System.Globalization
Public Class localizedPage
Protected Overloads Overrides Sub InitializeCulture()
Dim cCulture As String = ""
Dim objProfile As ProfileCommon = CType(HttpContext.Current.Profile, ProfileCommon)
If Not (objProfile.Language Is Nothing) Then
cCulture = objProfile.Language
End If
If cCulture.Length > 0 Then
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(cCulture)
System.Threading.Thread.CurrentThread.CurrentUICulture = New System.Globalization.CultureInfo(cCulture)
End If
MyBase.InitializeCulture()
End Sub
End Class
Errors:
1) sub initializeculture cannot be declared ovverrides because it does not override a sub in a base class
2) language is not a member of profilecommon
3) initializecluture is not a member of objects
Hi Rob,
I would prefer not to rely on cookies
regards
Luca