System.Web.UI.WebControls.ValidatedControlConverter Class

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

See Also: ValidatedControlConverter Members

Syntax

public class ValidatedControlConverter : ControlIDConverter

Remarks

Not all controls can be validated with a validation control. This class creates a collection of control IDs 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 enable 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:

Example

<TypeConverter(GetType(ValidatedControlConverter))> _
 Public Property ControlToValidate() As String
    Get    
       // Add code to get the ID of the control to validate.
    End Get
    Set
       // Add code to set the ID of the control to validate.
    End Set
 End Property

Example

[TypeConverter(typeof(ValidatedControlConverter))]
 public string ControlToValidate
 {
    get 
    {
       // Add code to get the ID of the control to validate.
    }
    set
    {
       // Add code to set the ID of the control to validate.
    }
 }

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0