M
Mr. x
Hello,
I have some code as follows.
It seems that customValidator doesn't work - because i don't get any
message.
In the body :
<asp:table>
<asp:TableRow>
<asp:TableCell>
<asp:RequiredFieldValidator
ControlToValidate="a_email"
Text="*"
runat="server" />
</asp:TableCell>
<asp:TableCell>email:</asp:TableCell>
<asp:TableCell><asp:TextBox id="a_email" runat="server"
/></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:CustomValidator
ControlToValidate="a_email"
OnServerValidate="checkEmail"
Text="Illegal"
ErrorMessage="Illegal"
runat="server" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
....
In the script :
<script runat = "server">
Sub checkEmail(source As object,args As ServerValidateEventArgs)
args.IsValid=false 'just testing - always false, but even this doesn't
work.
End sub
</script>
....
What is wrong in my code ?
Thanks
I have some code as follows.
It seems that customValidator doesn't work - because i don't get any
message.
In the body :
<asp:table>
<asp:TableRow>
<asp:TableCell>
<asp:RequiredFieldValidator
ControlToValidate="a_email"
Text="*"
runat="server" />
</asp:TableCell>
<asp:TableCell>email:</asp:TableCell>
<asp:TableCell><asp:TextBox id="a_email" runat="server"
/></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:CustomValidator
ControlToValidate="a_email"
OnServerValidate="checkEmail"
Text="Illegal"
ErrorMessage="Illegal"
runat="server" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
....
In the script :
<script runat = "server">
Sub checkEmail(source As object,args As ServerValidateEventArgs)
args.IsValid=false 'just testing - always false, but even this doesn't
work.
End sub
</script>
....
What is wrong in my code ?
Thanks