Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on a MVC application, In that I need to insert a value of html tag to be inserted in database. and I used textarea control, but I have found the error


A potentially dangerous Request.Form value was detected from the client (Body="

fa g

gas <...").



What should I need to do to resolve this.

I tried validaterequest in both on page and web.config with <httpRuntime requestValidationMode="2.0"/>

Posted

Have you checked this[^]? Maybe it can help.
 
Share this answer
 
First check this link : https://www.owasp.org/index.php/Top_10_2013-A3-Cross-Site_Scripting_(XSS)[^]

I would recommend doing it on a single page rather than disabling it for entire application like this:

In web-config:

XML
<location path="test.aspx">
  <system.web>
    <httpruntime requestvalidationmode="2.0" />
  </system.web>
</location>


and on page :

XML
<@ Page validateRequest="false" %>


after that you can check for the user input from that page pro-actively to avoid any security issues.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900