Form validation confusion

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?
 
T

Teemu Keiski

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.
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top