By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,137 Members | 2,282 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,137 IT Pros & Developers. It's quick & easy.

Validation Controls stop working!

P: n/a
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
mf*******@networkclub.co.uk
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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!
"Fernando Hunth" <Fe***********@discussions.microsoft.com> wrote in message
news:8F**********************************@microsof t.com...
Martyn:

I think that it is not a 2003 Problem.
It is true that .Net generates javascript for validations, but if you have
these controls at a container that you set it to Invisible, these controls
never are rendered and sent to client, because when you set the visibility
property on a control, it is never rendered.

Another cause of some validation control does not work is that you have a
script error, that causes that the javascript that is generated by .Net ,
does not run.

Hope this helps.

"Martyn Fewtrell" wrote:
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
mf*******@networkclub.co.uk

Nov 18 '05 #2

P: n/a
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: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Martyn Fewtrell" <mf*******@networkclub.co.uk> wrote in message
news:Ob**************@tk2msftngp13.phx.gbl...
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!
"Fernando Hunth" <Fe***********@discussions.microsoft.com> wrote in message news:8F**********************************@microsof t.com...
Martyn:

I think that it is not a 2003 Problem.
It is true that .Net generates javascript for validations, but if you have
these controls at a container that you set it to Invisible, these controls never are rendered and sent to client, because when you set the visibility property on a control, it is never rendered.

Another cause of some validation control does not work is that you have a script error, that causes that the javascript that is generated by .Net , does not run.

Hope this helps.

"Martyn Fewtrell" wrote:
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
mf*******@networkclub.co.uk


Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.