Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ProfileService::ValidatingProperties Event

 

Occurs when a user's profile properties are set.

Namespace:   System.Web.ApplicationServices
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

public:
event EventHandler<ValidatingPropertiesEventArgs^>^ ValidatingProperties {
	static void add(EventHandler<ValidatingPropertiesEventArgs^>^ value);
	static void remove(EventHandler<ValidatingPropertiesEventArgs^>^ value);
}

You can create an event handler for the ValidatingProperties event to validate property values or to dynamically change their values. The ValidatingProperties event is raised when the SetPropertiesForCurrentUser method is called. If the value for a property fails validation, add that property to the FailedProperties collection of the ValidatingPropertiesEventArgs class. Any properties that are in the FailedProperties collection will not be saved to the user profile.

You can add and register the event handler in the Global.asax file.

The following example shows an event handler for the ValidatingProperties event. When the value passed for FirstName property is empty or null, the FirstName property is added to the FailedProperties collection.

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

.NET Framework
Available since 3.5
Return to top
Show:
© 2017 Microsoft