Client Side Validation Controls

  • Thread starter Thread starter Gareth
  • Start date Start date
G

Gareth

Hi, I've just published a test web site on the internet with a simple form
and some client side validation controls. On my development PC if I click
submit without entering any data the validation controls work and prompt me
as expected.
On the live web server I do exactly the same thing but no validation is
performed and the form is submitted.
How can this be?
Have I missed something in the setup script? I added both the primary
output files and the content files to the build script is there anything
else I need to add?

Thanks,
Gareth
 
Client side validation is done using the scripts in the "aspnet_client"
folder. Does this folder exist in your application? It's usually installed
into each website (in IIS) when the framework is installed. If your
application is running in a virtual directory, then the aspnet_client folder
needs to be in the root folder of that website.

Hope this helps,

Mun
 
Also note that if client-side validation fails for a reason or another you
need to check Page.IsValid before any validation-dependant critical code
runs. This way you can be sure that no incorrect input is passed through
even if client-side validation would fail. Server-side validation always
fires automatically with built-in validation controls, but you must manually
check Page.IsValid.
 
Thank you both for those tips. I have now solved my problem.

1) I had not set permission for the custom account to access (read) the
aspnet_client directory.
2) I was not checking the Page.IsValid property on the submission.

Implementing both of these cured my problems.
Many thanks once again!
Regards,
Gareth
 
Back
Top