Migrating Anonymous Profiles : Anonymous Profiles « Profile « ASP.NET Tutorial






MigrateAnonymous event handler automatically copies the values of all anonymous Profile properties to the user's current authenticated profile.

File: Global.asax

<%@ Application Language="C#" %>
<script runat="server">

    public void Profile_OnMigrateAnonymous(object sender, ProfileMigrateEventArgs args)
    {
        ProfileCommon anonProfile = Profile.GetProfile(args.AnonymousID);

        foreach (SettingsProperty prop in ProfileBase.Properties)
            Profile[prop.Name] = anonProfile[prop.Name];

        ProfileManager.DeleteProfile(args.AnonymousID);
        AnonymousIdentificationModule.ClearAnonymousIdentifier();
    }

</script>








15.1.Anonymous Profiles
15.1.1.Enable Anonymous Identification and defines a Profile property that can be modified by anonymous users.
15.1.2.Migrating Anonymous Profiles
15.1.3.Turning on anonymous capabilities personalization properties