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
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 PropertyExample
[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.
}
}