A potentially dangerous request.form value was detected. Description: ASP. NET has detected potentially dangerous data in the request

Source: Internet
Author: User

Add [ValidateInput (false)] to the top of the request method.

From the client (content= "


Sdfdddd

A potentially dangerous request.form value was detected in the. Description: ASP. NET has detected potentially dangerous data in the request because it may include HTML tags or scripts. This data may indicate an attempt to compromise application security, such as cross-site scripting attacks. If this type of input applies to your application, you can include code from pages that are explicitly allowed. For more information, see http://go.microsoft.com/fwlink/?LinkID=212874.

Exception Details: System.Web.HttpRequestValidationException: From the client (content= "


Sdfdddd

A potentially dangerous request.form value was detected in the.


Previously, you could disable request validation by setting validaterequest= "false" in the page directive or configuration section when using ASPX pages.
However, the use of MVC (Razor) is not valid. Notice the search that you only need to add validateinput (false) to the action requested by the page.
Such as:
[ValidateInput (False)]
Public ActionResult AddData () {
.............
}

A potentially dangerous request.form value was detected. Description: ASP. NET has detected potentially dangerous data in the request

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.