User-284642143 posted
I have a form with a number of fields. Each field is then encoded i.e.
try {
var Name = Server.HtmlEncode(txtName.Text);
}
catch(.....
before sending an email to the admin of the site. All this works but i get a few server errors with
Exception type: HttpRequestValidationException
Exception message: A potentially dangerous Request.Form value was detected from the client (Control ID with some javascript)
I understand why this is happening and have also limited all textboxes with XX amount of characters (theres a lot of javascript code being thrown into these boxes) but would it be appropriate to catch this exception in code behind and ignore it or redirect
to another page?
I just dont want to fill the server logs with events that i can ignore but of course if theres some action i need to take i would rather do that?