Form validation confusion

  • Thread starter Thread starter AGB
  • Start date Start date
A

AGB

Hi all,

I have a form with several validation controls on it. My understanding
is that if the client-side validation fails, the form shouldn't be
posting back to the server...correct?

As it stands right now, my form pops up the validation control error
messages AND posts back to the server.

Any help?
 
Hello,

that could be the case if you use it on other browser than IE (with ASP.NET
v1 IE is the only browser with what client-side validation works, with v2 it
works with the major ones). However, You need always to have Page.IsValid
check within the code of the control (say a Button) that submits the form.
With that you can check on server if validation failed and prevent the
critical sectrion of code from running.
 
Back
Top