Checking IsValid in the web form

R

R.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
 
N

Nicole Calinoiu

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
 
G

Granger Godbold

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.
 
N

Nicole Calinoiu

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top