I have a Custom Control that has multiple textbox fields and a checkbox contained within it.
If the checkbox is checked, and the user submits the form, I need to allow them to continue if the textbox's are empty (and the checkbox is checked).
I have to implement this without javascript.
The problem is that on the OnInit event of the Custom Control, where I wire up the textboxes and their validators, I cannot access the value of the checkbox.
I have been trying to override the uniqueid of the checkbox so that in the custom controls's OnInit event I can disable the required fieldvalidators if this.Context.Request.Form["CheckboxId"] = "On", but as soon as I override the uniqueID of the checkbox viewstate stopped working.
The other thing I thought of is having a custom requiredfieldvalidator that takes the Checkbox in the constructor and is disabled if the value is false.