ProfileEventArgs::Profile Property
Gets or sets the user profile for the current request.
Assembly: System.Web (in System.Web.dll)
public: property ProfileBase^ Profile { ProfileBase^ get (); void set (ProfileBase^ value); }
Property Value
Type: System.Web.Profile::ProfileBaseThe user profile to use for the current request. The default is nullptr.
You can use the Profile property during the Personalize event to specify a custom user profile. If, when the Personalize event completes, the ProfileEventArgs parameter of the ProfileEventHandler has its Profile property set to a value that’s not nullptr, then the ProfileModule uses the value of the Profile property in the current HttpContext.
Note |
|---|
The ProfileModule does not set the Profile property for the Personalize event. The ProfileModule only gets the value of the Profile property when the code in the Personalize event completes. If the ProfileEventArgs::Profile property is not explicitly set by application code during the Personalize event, the Profile property value will be nullptr. |
The following code example shows the Personalize event declared in the Global.asax file for an application. The event code loads a user profile based on role membership.
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.
Note