ProfileEventArgs::Profile Property


Gets or sets the user profile for the current request.

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

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 null.

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 null, then the ProfileModule uses the value of the Profile property in the current HttpContext.


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 null.

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
Available since 2.0
Return to top