Professional Web Applications Themes

Custom Validator - ASP.NET General

I added a custom validator and added some code to its ServerValidate event but when a data which is not accepted is entered, it gives the warning as it should do, but doesn't stop the execution of Click event of my submit button. RequiredFieldValidator for example, gives the error when the field is empty and does not let the code continue execution. So do I miss something in definition of CustomValidator? Serdar KALAYCI --...

  1. #1

    Default Custom Validator

    I added a custom validator and added some code to its ServerValidate event
    but when a data which is not accepted is entered, it gives the warning as it
    should do, but doesn't stop the execution of Click event of my submit
    button. RequiredFieldValidator for example, gives the error when the field
    is empty and does not let the code continue execution. So do I miss
    something in definition of CustomValidator?

    Serdar KALAYCI

    --



    Serdar Kalaycý Guest

  2. #2

    Default Re: Custom Validator

    Ok, I understand that I have to use client side validation with server side
    validation. But I cannot access server side components in my client side
    script (eg. TextBox1.Text) and because my validation relies on more than one
    component, it's also impossible to get the values from parameters. What must
    I do?

    Serdar Kalayci
    "Teemu Keiski" <jotekeaspalliance.com> wrote in message
    news:u4ZBKgIRDHA.2320TK2MSFTNGP12.phx.gbl...
    > Hi,
    >
    > take a look at this article:
    >
    > ASP.NET Validation In Depth
    >
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html[/url]
    /aspplusvalid.asp
    >
    > It will explain you all the details about validation, including
    > CustomValidator.
    >
    > --
    > Teemu Keiski
    > MCP,Designer/Developer
    > Mansoft tietotekniikka Oy
    > [url]http://www.mansoft.fi[/url]
    >
    > ASP.NET Forums Moderator, [url]www.asp.net[/url]
    > AspAlliance Columnist, [url]www.aspalliance.com[/url]
    >
    > Email:
    > [email]jotekeaspalliance.com[/email]
    >
    >
    > "Serdar Kalaycý" <serdarkalayciunisec.com.tr> kirjoitti viestissä
    > news:e9OiiQIRDHA.3796tk2msftngp13.phx.gbl...
    > > I added a custom validator and added some code to its ServerValidate
    event
    > > but when a data which is not accepted is entered, it gives the warning
    as
    > it
    > > should do, but doesn't stop the execution of Click event of my submit
    > > button. RequiredFieldValidator for example, gives the error when the
    field
    > > is empty and does not let the code continue execution. So do I miss
    > > something in definition of CustomValidator?
    > >
    > > Serdar KALAYCI
    > >
    > > --
    > >
    > >
    > >
    >
    >

    Serdar Kalaycý Guest

Similar Threads

  1. validator qs.(1.5)
    By trycold in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: April 17th, 08:23 PM
  2. Adding Validator Control at runtime in a Custom Control
    By mudasir.ahmed@gmail.com in forum ASP.NET Building Controls
    Replies: 1
    Last Post: December 17th, 09:14 PM
  3. custom validator and ControlToValidate in a composite control...
    By Donal McWeeney in forum ASP.NET Building Controls
    Replies: 1
    Last Post: September 29th, 08:45 AM
  4. Validator and custom control question
    By Henk in forum ASP.NET Building Controls
    Replies: 1
    Last Post: April 13th, 05:56 PM
  5. Custom Range Validator how-to?
    By jdn in forum ASP.NET Building Controls
    Replies: 11
    Last Post: January 21st, 08:23 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139