M
Martin
Dear Group
Instead of placing Field Validators on the Form, I would like them to
create programatically but get an 'Object reference not set to an
instance of an object.' error. Following the sample code. I'm grateful
for any hints!
Thanks for your time and efforts!
Martin
Private Sub Submit()
Dim FVal1 As New RequiredFieldValidator
FVal1.ControlToValidate = "FirstnameTxt"
FVal1.Validate() '---It fails in this line
If FVal1.IsValid = False Then
Label1.Text = "You need to Provide a Firstname!"
Exit Sub
End If
...
End Sub
Instead of placing Field Validators on the Form, I would like them to
create programatically but get an 'Object reference not set to an
instance of an object.' error. Following the sample code. I'm grateful
for any hints!
Thanks for your time and efforts!
Martin
Private Sub Submit()
Dim FVal1 As New RequiredFieldValidator
FVal1.ControlToValidate = "FirstnameTxt"
FVal1.Validate() '---It fails in this line
If FVal1.IsValid = False Then
Label1.Text = "You need to Provide a Firstname!"
Exit Sub
End If
...
End Sub