|
Good morning,
I've been tasked to create a series of self-validating composite controls using standard Visual Studio/AJAX controls and some custom-made validation controls.
One of them is just a simple textbox. In the class, I added a property IsRequired that if set to true, enables the validator, or if false, disables the validator.
My problem lies in that the IsRequired property is defaulting to true, i.e. when I add the composite control to a webform, if I don't explicitly set IsRequired to false, it causes it to validate.
I want to set the default value to false, but I'm unsure how to accomplish this. Any help would be appreciated. The property is as follows:
Public WriteOnly Property IsRequired() As Boolean
Set(ByVal value As Boolean)
If value = False Then
isRequiredValidator.Enabled = False
Else
isRequiredValidator.Enabled = True
End If
End Set
End Property
|