Gets or sets a value indicating whether the ProfileModule will automatically save the user profile.
Assembly: System.Web (in System.Web.dll)
The Save method automatically determines whether properties that are made up of primitive types, strings, or DateTime objects have been changed, by checking the IsDirty property value for each SettingsPropertyValue in the user profile. The Save method cannot explicitly determine whether a custom class has changed. You can use the ProfileAutoSaving event to determine whether a custom object has been modified and then either continue with the automatic save if the object has been modified or cancel the automatic save if the object has not been modified.
To cancel the automatic profile save operation, set the property to false in the ProfileAutoSaving event; otherwise, set the property to true.
There may be multiple subscribers to the ProfileAutoSaving event. The ProfileModule will use the last value that the property is set to. As a result, it is recommended that you explicitly set the property in the ProfileAutoSaving event whether you are canceling or continuing with the automatic save, as you may need to overwrite the value set by an earlier subscriber.
The following code example shows the ProfileAutoSaving event included in the Global.asax file for an ASP.NET application.
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