Solution to "detecting potentially dangerous form values" in ASP. NET)

Source: Internet
Author: User

By default,. Net has a high security level. It will detect the characters in the form submitted by the user.
<XXX>
If this character is entered, an error is returned:

A potentially dangerous request. form value is detected from the client ("<p>.

Solution 1
In web. config, configure not to detect data submitted by the user:
The method is as follows: add a configuration information in Web. config, which will prevent all pages of the site from being detected.
CodeAs follows:

<? XML version = "1.0" encoding = "gb2312"?>
<Configuration>
<System. Web>
<Pages validaterequest = "false"/>
</System. Web>
</Configuration>

Solution 2
The method for checking the current page is to <% PAGE Language = "C #" validaterequest = "false "...
Add this vaildaterequets = "false" in.

Related Article

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.