Turn-detect potential risks

Source: Internet
Author: User

 

The problem is as follows... The reason is that in ASP. in NET 1.1, after the validaterequest attribute on the @ page command is opened, check to make sure that the user does not send potentially risky HTML tags in the query string, Cookie, or form field. If this situation is detected, an exception is thrown and the request is aborted. This attribute is enabled by default. You do not need to perform any operation to protect it. If you want to allow HTML markup to pass, you must manually disable this attribute. Solution:

Method 1. Modify the. aspx File

Add validaterequest = "false" to the. aspx file, for example:

<% @ Page validaterequest = "false" Language = "C #" codebehind = "writenews. aspx. cs" autoeventwireup = "false" inherits = "news. writenews" %>

Method 2: configure the Web. config file
<? XML version = "1.0" encoding = "UTF-8"?>
<Configuration>

<System. Web>

<! -- This statement must be added when writenews. aspx uses the content edit box. Otherwise, the request value cannot be added.
-->
<Pages validaterequest = "false"/>

</System. Web>
</Configuration>

Method 1. No problem --

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.