J
Jim Heavey
I have the following code to create a CustomValidator control in code:
'* Add Custom Validator
Dim cvl1 As New CustomValidator()
cvl1.ID = "cvlAddRating"
cvl1.Display = ValidatorDisplay.Dynamic
cvl1.ControlToValidate = "ddladdRating"
cvl1.ErrorMessage = "Must make a selection"
cvl1.EnableClientScript = "False"
Now I want to associate this control to the event for the "ServerValidate"
event. How do I do this. I thught maybe the following code was part of
the solution, but not all.
Dim it As New System.Web.UI.WebControls.ServerValidateEventHandler
(AddressOf Me.ValidateDropDownSelection)
Am I headed in the right direction? How do I assign "it" to the control
(cvl1)?
'* Add Custom Validator
Dim cvl1 As New CustomValidator()
cvl1.ID = "cvlAddRating"
cvl1.Display = ValidatorDisplay.Dynamic
cvl1.ControlToValidate = "ddladdRating"
cvl1.ErrorMessage = "Must make a selection"
cvl1.EnableClientScript = "False"
Now I want to associate this control to the event for the "ServerValidate"
event. How do I do this. I thught maybe the following code was part of
the solution, but not all.
Dim it As New System.Web.UI.WebControls.ServerValidateEventHandler
(AddressOf Me.ValidateDropDownSelection)
Am I headed in the right direction? How do I assign "it" to the control
(cvl1)?