Message form error
Can someone please explain what might be causing this error. I think these are quotes.
Exception Details: System.Web.HttpRequestValidationException: A potentially
dangerousRequest.Form value was detected from the client
(ctl00$ContentPlaceHolder1$DetailsView1$txtContent="...l economy.<br /><br />The
Prop...").
source to share
The content of the control (possibly a text box) contains what ASP.net considers to be markup, for example:
<br /><br />
You can add ValidateRequest = "false" to the page directive in the .aspx file like this:
<%@ Page ........ ValidateRequest="false" ........ %>
As other answers point out, asp.net does this to try to protect you from potentially malicious input, so make sure you are aware of the risk and encode / decode user data appropriately.
source to share
It will be '<' and '>'.
EDIT: Including html records in form responses is supposed to be an attack on the server that the form is on. So, by default, any code that looks like html (i.e. includes '<' or '>') is automatically flagged as a problem.
One way to work around this problem is to disable this type of validation by setting validateRequest = "false" to the page directive for that page, but there are other (and better) ways that work.
source to share
Its html "<br />" tags.
Here's an article with a short explanation . It also shows how to get around it by disabling validation. Although I think it would be a little dangerous to just turn it off.
source to share
My idea is to allow this exception. Use the Application_Error handler to write code that redirects (using Response.Redirect - this is important because it allows the browser to return users) to the custom error page. On this page, write text that explains that users have entered the wrong text. Something like:
"Dear user, you entered incorrect text, for example" <"or". "Enter text using only symbols and numbers."
Place a link to this page and that link may contain a javascript "back" command:
href="javascript: history.go(-1)"
Users after clicking such a link will be redirected by their browsers to the previous page, where they can re-edit their input.
source to share