Checking IsValid in the web form

Discussion in 'ASP .Net' started by R.A., May 12, 2004.

  1. R.A.

    R.A. Guest

    Hi

    If I use the client side validation control, do I need to check for IsValid
    on the server side? if yes then why?


    Thanks
    R.A., May 12, 2004
    #1
    1. Advertising

  2. Yes since you cannot be certain that client-side validation will be
    executed. Some examples of when this might happen:

    1. Client browser does not support the validation code.
    2. Client browser has javascript disabled.
    3. Post to the form comes from outside your application.

    Any of these might be due to either "innocent" and valid client behaviour.
    However, you should also be protecting yourself against malicious attempts
    to hack your application, which can use any of the above mechanisms as well
    in order to deliberately bypass client-side validation.

    HTH,
    Nicole


    "R.A." <> wrote in message
    news:...
    > Hi
    >
    > If I use the client side validation control, do I need to check for
    > IsValid
    > on the server side? if yes then why?
    >
    >
    > Thanks
    >
    >
    Nicole Calinoiu, May 12, 2004
    #2
    1. Advertising

  3. Definitely.
    #1: There's no guarantee the client-side stuff wasn't bypassed or otherwise didn't work. It's
    pretty trivial to get around Javascript validation if you want to; I've done it a number of times
    myself simply because the page's validation code was broken but I needed to use the form anyways.

    R.A. wrote:

    > Hi
    >
    > If I use the client side validation control, do I need to check for IsValid
    > on the server side? if yes then why?
    >
    >
    > Thanks
    >
    >
    Granger Godbold, May 12, 2004
    #3
  4. R.A.

    R.A. Guest

    Should I call Page.Validate before checking IsValid?


    "Nicole Calinoiu" <> wrote in message
    news:...
    > Yes since you cannot be certain that client-side validation will be
    > executed. Some examples of when this might happen:
    >
    > 1. Client browser does not support the validation code.
    > 2. Client browser has javascript disabled.
    > 3. Post to the form comes from outside your application.
    >
    > Any of these might be due to either "innocent" and valid client behaviour.
    > However, you should also be protecting yourself against malicious

    attempts
    > to hack your application, which can use any of the above mechanisms as

    well
    > in order to deliberately bypass client-side validation.
    >
    > HTH,
    > Nicole
    >
    >
    > "R.A." <> wrote in message
    > news:...
    > > Hi
    > >
    > > If I use the client side validation control, do I need to check for
    > > IsValid
    > > on the server side? if yes then why?
    > >
    > >
    > > Thanks
    > >
    > >

    >
    >
    R.A., May 12, 2004
    #4
  5. Yes. The validators are not polled until you call the Validate method. The
    requirement to call Validate before IsValid is mentioned in the
    documentation for the IsValid property.


    "R.A." <> wrote in message
    news:...
    > Should I call Page.Validate before checking IsValid?
    >
    >
    > "Nicole Calinoiu" <> wrote in message
    > news:...
    >> Yes since you cannot be certain that client-side validation will be
    >> executed. Some examples of when this might happen:
    >>
    >> 1. Client browser does not support the validation code.
    >> 2. Client browser has javascript disabled.
    >> 3. Post to the form comes from outside your application.
    >>
    >> Any of these might be due to either "innocent" and valid client
    >> behaviour.
    >> However, you should also be protecting yourself against malicious

    > attempts
    >> to hack your application, which can use any of the above mechanisms as

    > well
    >> in order to deliberately bypass client-side validation.
    >>
    >> HTH,
    >> Nicole
    >>
    >>
    >> "R.A." <> wrote in message
    >> news:...
    >> > Hi
    >> >
    >> > If I use the client side validation control, do I need to check for
    >> > IsValid
    >> > on the server side? if yes then why?
    >> >
    >> >
    >> > Thanks
    >> >
    >> >

    >>
    >>

    >
    >
    Nicole Calinoiu, May 12, 2004
    #5
    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. Emilio
    Replies:
    6
    Views:
    56,052
  2. Simon Harvey

    Calling IsValid in a web control

    Simon Harvey, Aug 5, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,919
    DujHoD
    Aug 6, 2004
  3. Replies:
    0
    Views:
    401
  4. Simon Harvey

    Calling IsValid in a web control

    Simon Harvey, Aug 5, 2004, in forum: ASP .Net Building Controls
    Replies:
    3
    Views:
    127
    DujHoD
    Aug 6, 2004
  5. Simon Harvey

    Calling IsValid in a web control

    Simon Harvey, Aug 5, 2004, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    103
    DujHoD
    Aug 6, 2004
Loading...

Share This Page