CustomValidator and usercontrols

J

JB

I have a client side function like this : the intention is to check a
couple of textboxes that reside inside a *usercontrol*. They must be
either both empty or both not empty else it is not valid.

Can anyone help? It always returns False a present...

<script language="vbscript">
Sub ClientValidate(source, args)

Dim ret As Boolean = True
'locate the user con'trol
_ucArrangement = DirectCast(FindControl("ucArrangementDetails1"),
CIC.ucArrangementDetails)

' Test whether the Account Number/BSB is/not Empty.
If _ucArrangement.BSBNumberControl.Text.Length > 0 AndAlso
_ucArrangement.AccountNumberControl.Text.Length = 0 Then
ret = false
End If

If _ucArrangement.BSBNumberControl.Text.Length = 0 AndAlso
_ucArrangement.AccountNumberControl.Text.Length > 0 Then
ret = False
End If

args.IsValid = ret

End Sub
</script>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,079
Messages
2,570,573
Members
47,205
Latest member
ElwoodDurh

Latest Threads

Top