Solution in case of a request. form value error detected from the client

Source: Internet
Author: User

The request. form value is detected in the client (tbname = "'; -- <script language =" ja.

Note:The request verification process detects potentially dangerous client input values, and the processing of the request has been aborted. This value may indicate attempts to compromise application security, such as cross-site scripting attacks. By running the page command or

Set validaterequest = false in the configuration section to disable request verification. However, in this case, it is strongly recommended that the application explicitly check all input.

Exception details:System. Web. httprequestvalidationexception: a potentially dangerous request. form value is detected from the client (tbname = "'; -- <script language =" ja.

In the following code, <% @ page validaterequest = "false" Language = "C #" codebehind = "01input. aspx. CS "autoeventwireup =" false "inherits =" commandexample. login "%>Add validaterequest = "false"
Or Add the following code to the Web. config configuration file: <? XML version = "1.0"?>
<Configuration>
<System. Web>
<Compilation defaultlanguage = "C #" DEBUG = "true">
<Compilers>
<Compiler language = "C #" type = "Microsoft. CSHARP. csharpcodeprovider, system, version = 2.0.0.0, culture = neutral, publickeytoken = b77a5c561934e089 "extension = ". CS "compileroptions ="/D: Debug; trace "/> </compilers> </compilation>
<Pages validaterequest = "false" enablesessionstate = "true" enableviewstate = "true"/>
Bytes ----------------------------------------------------------------------------------------------------------------------
<Customerrors defaultredirect = "error.htm" mode = "off"/>
<Globalization fileencoding = "gb2312" requestencoding = "gb2312" responseencoding = "gb2312" Culture = "ZH-CN"/>
<Xhtmlconformance mode = "Legacy"/> </system. Web>
</Configuration>

Configure validaterequest = "false" for all pages of the website ".

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.