This documentation is archived and is not being maintained.

SettingsSavedEventArgs.FailedSettingsList Property

Gets the settings that the ClientSettingsProvider was unable to save to the server.

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

Public ReadOnly Property FailedSettingsList As ReadOnlyCollection(Of String)
Dim instance As SettingsSavedEventArgs 
Dim value As ReadOnlyCollection(Of String)

value = instance.FailedSettingsList

Property Value

Type: System.Collections.ObjectModel.ReadOnlyCollection(Of String)
The settings that were not 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.

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

Private WithEvents settingsProvider As ClientSettingsProvider = My.Settings _

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

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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

.NET Framework

Supported in: 3.5