validation controls not working on production server

  • Thread starter Thread starter earwicker
  • Start date Start date
E

earwicker

I recently deployed a web application which contains a user registration
form with the usual fields: name, address, email, password, etc. Each of the
TextBoxes uses a validation control to verify the input. On my development
server, this form works precisely as expected.

When I deploy the app to the production server (a hosting service), the
client-side validation quits working altogether. Now, I KNOW that scripts
are enabled and working in my browser (I use the same browser to access the
app on both development and production servers), and I've changed NOTHING
whatsoever before uploading the application. All other functionality works
the same on both servers.

Any help with this issue would be greatly appreciated.

---e[ch]
 
It is most likely your WPP does not have the JavaScript scripts installed in
your application space. This is done with aspnet_regiis. If I remember
correctly, the correct flag for scripts is /c. Without the scripts
installed, you will either have to subclass the validation controls to point
at your own copies of the script, or ditch client side validation
altogether.

Now I will add a note about how to properly use validation. Despite having
Client Side validation, you should always check Page.IsValid prior to
submitting any code. This stops hackers from working around your form
validation to get errors to figure out your code, et al.

The Client side script is still useful, albeit when working, as it reduces
load on the server from multiple trips for validation. NOTE that validation
does not work, client side, in all browsers. This alone is a good reason for
server side checking.


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
greg---



Thanks for your reply, but in the interim I have learned that you are not
entirely correct. You say:



"you will either have to subclass the validation controls to point

at your own copies of the script, or ditch client side validation

altogether."



This is false. You needn't go through the pain of subclassing the controls
at all. All you need to do is upload your own copy of WebUIValidation.js
(and the SmartNav script files, too, if you need them) to some directory
within your web application, and add the following line to your web.config
file:



<webControls
clientScriptsLocation="YourApp/YourScriptsDirectory/" />



And voila! It all works fine. Quick, easy, and painless.



Don't configuration files rock???



Thanks for your help,



---earwicker[ch]











message news: said:
It is most likely your WPP does not have the JavaScript scripts
installed in your application space. This is done with aspnet_regiis.
If I remember correctly, the correct flag for scripts is /c. Without
the scripts installed, you will either have to subclass the validation
controls to point at your own copies of the script, or ditch client
side validation altogether.

Now I will add a note about how to properly use validation. Despite
having Client Side validation, you should always check Page.IsValid
prior to submitting any code. This stops hackers from working around
your form validation to get errors to figure out your code, et al.

The Client side script is still useful, albeit when working, as it
reduces load on the server from multiple trips for validation. NOTE
that validation does not work, client side, in all browsers. This
 
Back
Top