By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 1,210 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

Composite control default value?

P: 5
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
isRequiredValidator.Enabled = True
End If
End Set
End Property
May 5 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.