This documentation is archived and is not being maintained.

ValidatorCollection.IsReadOnly Property

Gets a value that indicates whether the ValidatorCollection is read-only.

[Visual Basic]
Public ReadOnly Property IsReadOnly As Boolean
[C#]
public bool IsReadOnly {get;}
[C++]
public: __property bool get_IsReadOnly();
[JScript]
public function get IsReadOnly() : Boolean;

Property Value

true if the collection is read-only; otherwise, false.

Example

[Visual Basic, C#] The following example demonstrates using the IsReadOnly property.

[Visual Basic] 
' Get 'Validators' of the page to myCollection.
Dim myCollection1 As ValidatorCollection = Page.Validators
' Get 'IsReadOnly' property of 'ValidatorCollection'.
Dim readOnly_bool As Boolean = myCollection1.IsReadOnly

' Get 'IsSynchronized' property of 'ValidatorCollection'.
Dim synchronized_bool As Boolean = myCollection1.IsSynchronized

' Get a synchronized object of the 'ValidatorCollection'.
Dim myCollection2 As ValidatorCollection = CType(myCollection1.SyncRoot, ValidatorCollection)
myCollection1.Add(myCollection1(0))

[C#] 
// Get 'Validators' of the page to myCollection.
ValidatorCollection myCollection1 = Page.Validators;

// Get 'IsReadOnly' property of 'ValidatorCollection'.
bool readOnly_bool = myCollection1.IsReadOnly;

// Get 'IsSynchronized' property of 'ValidatorCollection'.
bool synchronized_bool = myCollection1.IsSynchronized;

// Get a synchronized object of the 'ValidatorCollection'.
ValidatorCollection myCollection2 = (ValidatorCollection)myCollection1.SyncRoot;
myCollection1.Add(myCollection1[0]);

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

ValidatorCollection Class | ValidatorCollection Members | System.Web.UI Namespace

Show: