Validation Controls stop working!

M

Martyn Fewtrell

Dear All

I have a Windows 2003 Server with IIS6 where the validation controls on
ASP.Net pages no longer work.

I believe it to be specific to the server as if I create an ASP.Net page on
the IIS Server of my Workstation (Win XP) with a text box, button and
required field validator, this works fine. If I create the same page on the
IIS6 Windows 2003 Server the validation control doesn't stop the post. I've
tried different browsers and JavaScript is on!

For example if I have a number of panels in which the visibility is turned
on or off by the button click event this event still fires. The visibility
on the panel where the validation control is situated turns off and the
error message is never seen. If I leave the visibility on that panel alone
then I see the error message but the click event still fires (not much use).

Looking at the code I presume that the validation control generates some
JavaScript which should be called on post. Is it possible that the Win 2003
Server isn't generating that JavaScript?

Anybody come across this before?

Any suggestions?

Martyn Fewtrell
(e-mail address removed)
 
M

Martyn Fewtrell

You are correct in what you are saying but this is not the problem!

If you have a form split into two parts - lets say contact details on the
first panel and then the enquiry details on the second panel.

Initially the first panel is set to visible = True and then the second panel
to visible = False. When you click the Next button the validation controls
should validate the controls on the first panel before running the click
event on the button i.e. it should stop the click event turning off the
first panel and then turning on the second panel.

This works perfectly on my workstation but if I copy the code onto the
server the validation controls just don't work and the click event still
fires changing the visibility on the forms. However if I disable the
visibility on the first panel i.e. instead of turning one off and one on, I
just turn the second one on then the error messages can be seen on the first
panel.

I therefore conclude that the error messages on the validator controls are
working but the validation control is failing to stop the click event from
following through.

I hope this explains it better!
 
P

Peter Blum

Two suggestions:

1. Make sure the validation script file, WebUIValidation.js, is installed
and associated with the version of ASP.NET running on that server. The
easiest way to do this is by running this command on that server:

[windows]\microsoft.net\framework\[version]\aspnet_regiis.exe -c

2. In one release of ASP.NET 1.1, there is a bug in the client-side code
that submits the page and causes the page it incorrectly submit. I don't
remember if it always blocks or always allows. Microsoft has put out some
hot fixes to ASP.NET 1.1. Look for them at msdn.microsoft.com to find the
one involved.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 

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

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top