Mimicking ValidateRequest

J

jacerhea

For our asp.net app we have ValidateRequest turned on. We would like
to add client side validation that mimics this validation so the users
will know when they have entered bad data. So my first question is,
does anyone know of a regular expression that mimics this behavior?

Secondly, we want to do this across all textbox controls in the app
and time is a consideration. Would it be a better idea to recursively
iterate though each control on a page and add a regular expression
validator or should we try something like jquery to do this on the
client side? I'm not that familiar with jquery and am not sure how
well it play with the asp.net javascript.

Thanks in advance.
 
C

Cowboy \(Gregory A. Beamer\)

ValidateRequest examines for dangerous values and nothing extra. As people
should rarely enter do this unless they are trying something evil, I would
allow the server trip and tell them after they go there. I am not saying you
could not mimic ValidateRequest on the client, but rather that it would end
up being a lot of coding for something that is probably not going to be hit
by someone using the form correctly.

One potential exception is someone embedding HTML into a text box, but you
can clean out tags easily enough, if that is a problem.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top