What is the value of
txttodt.Text
?
You only test for equality to
String.Empty
. But what if
txttodt.Text
is
Nothing
?
A better way would be :
Sub Validatetxttodt(ByVal sender As Object, ByVal args As ServerValidateEventArgs)
Try
If (String.IsNullOrEmpty(txttodt.Text)) Then
args.IsValid = False
Else
args.IsValid = True
End If
Catch ex As Exception
args.IsValid = False
End Try
End Sub
But it doesn't solve the problem of the
Sub
not being executed...