Thanks for your help. Something you said about synchronizing helped me
solve my problem. Have an Happy New Year !!!
Public MustInherit Class MyPage
Inherits System.Web.UI.Page
Protected MustOverride Function GetProfile() As ProfileCommon
Protected Overrides Sub OnPreInit(ByVal e As System.EventArgs)
Dim currentProfile As ProfileCommon = Me.GetProfile
If currentProfile.IsAnonymous Then
If Not Me.Session("Username") Is Nothing Then
Dim userProfile As ProfileCommon =
currentProfile.GetProfile(Me.Session("Username"))
currentProfile.PreferredTheme =
userProfile.PreferredTheme
currentProfile.PreferredCulture =
userProfile.PreferredCulture
currentProfile.Save()
Me.Session.Remove("Username")
End If
Else
If Me.Session("Username") Is Nothing Then
Me.Session("Username") = currentProfile.UserName
End If
End If
Me.Theme = currentProfile.PreferredTheme
MyBase.OnPreInit(e)
End Sub
End Class
Brock Allen wrote:
Hmm, that's sort of hard, since you're not sure when they logout, especially
if it's simply due to cookie timout (meaning they don't make a request to
the server, yet they timeout and thus arelogged out). If this is an absolute
requirement, then you probabaly should keep the anon profile in synch with
the logged in profile when updates are necessary tot he logged in profile.
Sounds icky, though :(
-Brock
DevelopMentor
http://staff.develop.com/ballen