CustomValidator control not executing handler

K

ken bus

I've done everything to get it to validate but no luck:

HTML:

<asp:TextBox id="TextBox1" style="Z-INDEX: 152; LEFT: 39px; POSITION: absolute; TOP: 68px" runat="server"></asp:TextBox>

<asp:CustomValidator id="CustomValidator1" style="Z-INDEX: 153; LEFT: 201px; POSITION: absolute; TOP: 74px" runat="server" OnServerValidate="Test" ErrorMessage="CustomValidator Test" ControlToValidate="TextBox1"></asp:CustomValidator>

<script language="vb" runat="server">
Sub Test(ByVal source As System.Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
args.IsValid = False
TextBox1.text="Test"
End Sub
</script>

I've used code behind but it doesn't work either.
What am I doing wrong? Am having no trouble with the other validators.
Ken
 
S

Scott M.

It doesn't look like you've set the ClientValidationFunction property (which
is the name of the client side function that will run to validate the
control you've marked with the ControlToValidate property) and you don't
have a client-side function written either.


ken bus said:
I've done everything to get it to validate but no luck:

HTML:

<asp:TextBox id="TextBox1" style="Z-INDEX: 152; LEFT: 39px; POSITION:
absolute; TOP: 68px" runat="server"> said:
<asp:CustomValidator id="CustomValidator1" style="Z-INDEX: 153; LEFT:
201px; POSITION: absolute; TOP: 74px" runat="server" OnServerValidate="Test"
ErrorMessage="CustomValidator Test"
 

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
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top