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.

SettingsSavedEventArgs Class

Provides data for the ClientSettingsProvider.SettingsSaved event.

System.Object
  System.EventArgs
    System.Web.ClientServices.Providers.SettingsSavedEventArgs

Namespace:  System.Web.ClientServices.Providers
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

'Declaration
Public Class SettingsSavedEventArgs _
	Inherits EventArgs

The SettingsSavedEventArgs type exposes the following members.

  NameDescription
Public methodSettingsSavedEventArgsInitializes a new instance of the SettingsSavedEventArgs class.
Top

  NameDescription
Public propertyFailedSettingsListGets the settings that the ClientSettingsProvider was unable to save to the server.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

The ClientSettingsProvider.SettingsSaved event occurs after the settings provider accesses the settings service, even if the settings were not successfully saved. One reason that the provider might fail to save the settings is if the current user has been logged out. You can use the FailedSettingsList property to determine whether any settings were not successfully saved.

This event does not occur if the settings provider cannot access the settings service, which instead causes the provider to throw a WebException.

For more information about handling events, see Consuming Events.

The following example code demonstrates how to use this class to display a list of settings that were not successfully saved.

Private WithEvents settingsProvider As ClientSettingsProvider = My.Settings _
    .Providers("System.Web.ClientServices.Providers.ClientSettingsProvider")

Private Sub Form1_SettingsSaved(ByVal sender As Object, _
    ByVal e As SettingsSavedEventArgs) _
    Handles settingsProvider.SettingsSaved

    ' If any settings were not saved, display a list of them. 
    If e.FailedSettingsList.Count > 0 Then 

        Dim failedSettings As String = String.Join( _
            Environment.NewLine, e.FailedSettingsList.ToArray())

        Dim message As String = String.Format("{0}{1}{1}{2}", _
            "The following setting(s) were not saved:", _
            Environment.NewLine, failedSettings)

        MessageBox.Show(message, "Unable to save settings", _
            MessageBoxButtons.OK, MessageBoxIcon.Warning)

    End If 

End Sub

.NET Framework

Supported in: 4.5, 4, 3.5

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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft