CustomValidator control not executing handler

Discussion in 'ASP .Net Web Controls' started by ken bus, Jul 31, 2004.

  1. ken bus

    ken bus Guest

    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
     
    ken bus, Jul 31, 2004
    #1
    1. Advertising

  2. ken bus

    Scott M. Guest

    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" <> wrote in message
    news:...
    > 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
     
    Scott M., Aug 1, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rick White
    Replies:
    1
    Views:
    1,602
    Natty Gur
    Jan 13, 2004
  2. Stefan
    Replies:
    2
    Views:
    601
    Brock Allen
    Jul 26, 2005
  3. darrel
    Replies:
    12
    Views:
    744
  4. Aamir Ghanchi
    Replies:
    1
    Views:
    492
    Aamir Ghanchi
    Oct 2, 2007
  5. northof40
    Replies:
    3
    Views:
    209
    Nathan Sokalski
    Nov 2, 2007
Loading...

Share This Page