Mimicking ValidateRequest

  • Thread starter Thread starter jacerhea
  • Start date Start date
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.
 
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.

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

Blog:
http://feeds.feedburner.com/GregoryBeamer

*************************************************
| Think outside the box! |
*************************************************
 
Back
Top