validation controls not working on production server

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]
 
C

Cowboy \(Gregory A. Beamer\)

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!
**********************************************************************
 
E

earwicker

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
 

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,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top