This is strange and baffling. In my ASP.NET 2.0 app I have a form that uses a number of client-side validators. Custom, Regularexpression and RequiredField. My app requires that I enable or disable certain validators based on a dropdown selection. I do this in my codebehind event. All this works great in my dev environment however when I deploy to the server it does not. Mainly when I run the app from the server it will not allow me to enable or disable the validators in code. When I set the enabled property in the aspx file it remains in that state regardless of what I do in the server event. Again - this works perfectly in dev. Any suggestions? Could it be the version of .NET 2.0 is different on my dev machine and the server? I am at a loss and we are heading for production soon. Please help!
A:
Do the validators work at all on the production machine? That is, do they prevent you from entering invalid data?
I have a vague recollection of something like this happening to me. It may have been an issue of the JavaScript file needed by the validators not being sent from the server. Do a View Source, or turn on debugging (FireBug or IE8's F12 command). See if you're maybe getting JavaScript errors you didn't know about.
John Saunders
2009-04-07 22:31:17
The validators work when enabled from the start (that is in the aspx page). However I cannot disable them or enable them if they are set to enabled in the aspx page. My app requires this as different controls are enabled based on dropdown selection.
MikeD
2009-04-07 23:00:04
Ok, then this is not the problem I recall.
John Saunders
2009-04-07 23:10:21
+1
A:
This turned out to be a .NET version issue. Once I applied the 2.0 Service Pack 2 on the server my problems went away.
MikeD
2009-04-08 13:27:23