Potentially dangerous Request.Form value for Cancel button Click

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all
I have simple edit form. When user saves data that contains restricted
characters such as (< > , etc.) , regular expression validator will display
a warning message. It all works fine, but if users decides to exit the form
using Cancel button then error occurs: A potentially dangerous Request.Form
value was detected from the client. The Cancel button has CausesValidation
set to false.

Is there any way to avoid this error without setting <%@ Page
validateRequest="false" %>?
All I want to do is just exit the screen. I could probably clean all
textboxes on Cancel button click event using JavaScript. Is there better way
to handle this?
 
Back
Top