This documentation is archived and is not being maintained.

PersonalizationStateInfoCollection::Remove Method

Removes a PersonalizationStateInfo-derived object from the collection.

Namespace:  System.Web.UI.WebControls.WebParts
Assembly:  System.Web (in System.Web.dll)

public:
void Remove(
	String^ path, 
	String^ username
)

Parameters

path
Type: System::String

The relative application path of the personalization state object to be removed.

username
Type: System::String

The user name of the UserPersonalizationStateInfo-derived object to be removed.

ExceptionCondition
NotSupportedException

The collection was marked as read-only.

ArgumentNullException

path is null.

- or -

both parameters are null.

This method removes a PersonalizationStateInfo-derived instance from the collection. Any elements after the removed instance are moved up to occupy the vacant position. Internally, the count of the collection is decremented by one. Any enumerators currently active against the collection are invalidated.

If only path is provided, then the SharedPersonalizationStateInfo instance for that path is removed. If both path and username are provided, then the UserPersonalizationStateInfo instance for the combination of path and username is removed.

NoteNote:

You can try to remove a non-existing item from the collection; this action will not raise an exception.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

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, 3.0, 2.0
Show: