Export (0) Print
Expand All

ProfileEventArgs::Profile Property

Gets or sets the user profile for the current request.

Namespace:  System.Web.Profile
Assembly:  System.Web (in System.Web.dll)

public:
property ProfileBase^ Profile {
	ProfileBase^ get ();
	void set (ProfileBase^ value);
}

Property Value

Type: System.Web.Profile::ProfileBase
The 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.

NoteNote

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.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft