Help with CustomValidator in 1.1

  • Thread starter Thread starter David
  • Start date Start date
D

David

I need help with CustomValidator in 1.1. I added the CustomValidator
control and code as per the doc., (See below) However, the code is
never executed. Is there an extra switch or setting to force the
OnServerValidate code to execute?




<asp:CustomValidator id="CustomValidator1" runat="server"
ErrorMessage="CustomValidator" ControlToValidate="TextBox1"
OnServerValidate="val01"></asp:CustomValidator></P>



protected void val01(object source,
System.Web.UI.WebControls.ServerValidateEventArgs args)
{
args.IsValid = false;
}
 
David said:
I need help with CustomValidator in 1.1. I added the CustomValidator
control and code as per the doc., (See below) However, the code is
never executed. Is there an extra switch or setting to force the
OnServerValidate code to execute?




<asp:CustomValidator id="CustomValidator1" runat="server"
ErrorMessage="CustomValidator" ControlToValidate="TextBox1"
OnServerValidate="val01"></asp:CustomValidator></P>



protected void val01(object source,
System.Web.UI.WebControls.ServerValidateEventArgs args)
{
args.IsValid = false;
}
try adding causevalidation="true" to your submit image or button control

Mike
 

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

Back
Top