Re: only custom validation control does server side validation?

Discussion in 'ASP .Net' started by Colin Mackay, Jun 25, 2003.

  1. Colin Mackay

    Colin Mackay Guest

    On a CustomValidator you have to provide the validation code because
    otherwise it doesn't know what to do for the validation.

    Other validator controls use client and server side validation (for graceful
    degrading if the client doesn't support it). If you put another type of
    validator on an ASPX page then run in, you will find a line in generated
    source for your web page that looks like:
    <script language="javascript"
    src="/aspnet_client/system_web/1_1_4322/WebUIValidation.js"></script>
    This is the .NET client side validation.

    If you are creating a custom validator, you have to provide at least the
    server side validation (should the client not support scripts, or if the
    client has denied scripts the right to run), and optionally also the Client
    side validation. To tell .NET about your client side validation function you
    have to set EnableClientScript=true; and ClientValidatorFunction=<the string
    name of your function>

    Actually the ClientValidatorFunction string should be the name of your
    client side function without the parentheses, ASP.NET will add them and
    supply the values for the two parameters.

    I hope this helps,
    Colin.



    "Andy Nagai" <> wrote in message
    news:X1RJa.10040$...
    > Hi
    >
    > Ive noticed that only the customized validation control has the
    > ServerValidate event handler. Does this mean that only using that control
    > you can do server side validation?
    >
    > I mean you got to put some code on the server that responds to somekind of
    > event to do something.
    >
    >
     
    Colin Mackay, Jun 25, 2003
    #1
    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. Matt
    Replies:
    14
    Views:
    4,114
    Chad Z. Hower aka Kudzu
    Jan 30, 2004
  2. Ron
    Replies:
    0
    Views:
    1,232
  3. =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?=

    Using Summary Validation control with server Custom validation

    =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?=, Oct 15, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    885
    =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?=
    Oct 15, 2004
  4. Mythran
    Replies:
    2
    Views:
    517
    Mythran
    Jan 22, 2005
  5. =?Utf-8?B?dmlkeWE=?=
    Replies:
    1
    Views:
    758
    Kevin Spencer
    Jun 2, 2005
Loading...

Share This Page