A potentially dangerous request.form value is detected

Source: Internet
Author: User

The problem is that you submit a form that has an HTML string, such as when you enter HTML tags in a textbox, or if you use the HTMLEditor component in a page, the workaround is to disable validaterequest.

If you are. NET 4.0 or later, be sure to look at Method 3.

This method is applicable in both ASP. NET WebForm and MVC

Method 1:

Add this sentence to the header of the. aspx file:

<%@ page validaterequest="false"  %>

Method 2:

Modify the Web. config file:

<configuration>    <system.web>        <pages validaterequest="false" />    </system.web></configuration>

Because the validaterequest default value is true. Just set it to false.

Method 3:

Web. config adds

<system.web>    "2.0" /></ System.web>

Because the validation of 4.0 is enabled before HTTP beginrequest, the requested validation applies to all ASP. NET resources, ASPX pages, ashx pages, Web services, and some HTTP handlers.

[Turn]http://www.cnblogs.com/youring2/p/3559781.html

A potentially dangerous request.form value is detected

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.