I have an asp.net site....I would like to know how to handle this error gracefully when a user enters and submit an illegal character (xss attack).
"A potentially dangerous Request.Form value was detected from the client (ctl00$TextBox1="").........etc"
I can turn-off the requestvalidation attribute and write a code to filter the string with illegal characters but I think it's not a good practice to turn it off. I would rather leave this on and catch the error gracefully say redirecting the user to another page that would tell him/her the error. How would you do this?