This documentation is archived and is not being maintained.

ValidatedControlConverter Class

Converts a control on the Web Forms page that can be validated with a validation control to a string.

For a list of all members of this type, see ValidatedControlConverter Members.

System.Object
   System.ComponentModel.TypeConverter
      System.ComponentModel.StringConverter
         System.Web.UI.WebControls.ValidatedControlConverter

[Visual Basic]
Public Class ValidatedControlConverter
   Inherits StringConverter
[C#]
public class ValidatedControlConverter : StringConverter
[C++]
public __gc class ValidatedControlConverter : public
   StringConverter
[JScript]
public class ValidatedControlConverter extends StringConverter

Thread Safety

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

Remarks

Not all controls can be validated with a validation control. This class creates a collection of controls on the Web Forms page that can be associated with a validation control. This collection is commonly used in a designer to display a list of controls on the Web Forms page that can be associated with a validation control.

When creating your own validation control, you can provide the ability for the designer to display a list of controls that support validation controls. Simply add an attribute to the string property that represents the control to validate as follows:

[Visual Basic] 
<TypeConverter(GetType(ValidatedControlConverter))> _
Public Property ControlToValidate() As String
   Get    
      // Add code to get the name of the control to validate.
   End Get
   Set
  
      // Add code to set the name of the control to validate.
   
   End Set
End Property
   
[C#] 
[TypeConverter(typeof(ValidatedControlConverter))]
public string ControlToValidate
{
   get 
   {
      // Add code to get the name of the control to validate.
   }
   set
   {
      // Add code to set the name of the control to validate.
   }
}
   

Requirements

Namespace: System.Web.UI.WebControls

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

Assembly: System.Web (in System.Web.dll)

See Also

ValidatedControlConverter Members | System.Web.UI.WebControls Namespace | System.ComponentModel.TypeConverter

Show: