ProfileMigrateEventArgs Class
Provides data for the MigrateAnonymous event of the ProfileModule class.
Assembly: System.Web (in System.Web.dll)
The ProfileMigrateEventArgs type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | AnonymousID | Gets the anonymous identifier for the anonymous profile from which to migrate profile property values. |
![]() | Context | Gets the HttpContext for the current request. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
The ProfileMigrateEventArgs object provides event information to the MigrateAnonymous event of the ProfileModule class. The ProfileMigrateEventArgs object provides access to the HttpContext of the current request and the anonymous user identifier for the anonymous profile in the AnonymousID property.
You can use the MigrateAnonymous event to copy profile property values from an anonymous profile to an authenticated profile when a user who has been anonymously using your application logs in.
When an application that has the user profile enabled is started, ASP.NET creates a new class of type ProfileCommon, which inherits from the ProfileBase class. When the ProfileCommon class is generated, based on the profile properties specified in the Web.config file, a GetProfile method is added that enables you to retrieve a ProfileCommon object based on a user name. You can use the GetProfile method of the current profile to retrieve the property values of the anonymous profile. The anonymous property values can then be copied to the current profile for the authenticated user.
| Topic | Location |
|---|---|
| Walkthrough: Maintaining Web Site User Information with Profile Properties | Building ASP .NET Web Applications in Visual Studio |
The following code examples show a Web.config file that enables anonymous authentication and the MigrateAnonymous event included in the Global.asax file for an ASP.NET application.
The following code example shows a Web.config file that enables anonymous identification and profile properties that support anonymous users.
<configuration>
<system.web>
<authentication mode="Forms" >
<forms loginUrl="login.aspx" name=".ASPXFORMSAUTH" />
</authentication>
<AnonymousIdentification enabled="true" />
<profile enabled="true" defaultProvider="AspNetSqlProvider">
<properties>
<add name="ZipCode" allowAnonymous="true" />
<add name="CityAndState" allowAnonymous="true" />
<add name="StockSymbols" type="System.Collections.ArrayList" allowAnonymous="true" />
</properties>
</profile>
</system.web>
</configuration>
The following code example shows the MigrateAnonymous event included in the Global.asax file for an ASP.NET application. The MigrateAnonymous event copies profile property values from the anonymous profile to the profile for the current user.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.


