By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,289 Members | 3,049 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,289 IT Pros & Developers. It's quick & easy.

Checking IsValid in the web form

P: n/a
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
Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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." <te**@hotmail.com> wrote in message
news:ek**************@TK2MSFTNGP09.phx.gbl...
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

Nov 18 '05 #2

P: n/a
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


Nov 18 '05 #3

P: n/a
Should I call Page.Validate before checking IsValid?
"Nicole Calinoiu" <ni*****@somewhere.net> wrote in message
news:uQ**************@TK2MSFTNGP09.phx.gbl...
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." <te**@hotmail.com> wrote in message
news:ek**************@TK2MSFTNGP09.phx.gbl...
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


Nov 18 '05 #4

P: n/a
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." <te**@hotmail.com> wrote in message
news:eT**************@TK2MSFTNGP10.phx.gbl...
Should I call Page.Validate before checking IsValid?
"Nicole Calinoiu" <ni*****@somewhere.net> wrote in message
news:uQ**************@TK2MSFTNGP09.phx.gbl...
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." <te**@hotmail.com> wrote in message
news:ek**************@TK2MSFTNGP09.phx.gbl...
> 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
>
>



Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.