Potentially dangerous Request.Form value detected from the client [workaround]

Source: Internet
Author: User

What do I do when the page edits or runs the submission with a "potentially dangerous Request.Form value detected from the client" issue? As shown in: potentially dangerous detected from the client Request below the blogger summarizes several workarounds for this error: The cause of the problem: because in ASP. NET, when a request commits a string such as HTML code or JavaScript, the program system considers it to be a potentially dangerous value. The environment configuration will report an error such as "potentially dangerous Request.Form value detected from the client". 1, the current submission page, add code to open the current. aspx page, the page header plus code: validaterequest= "False", such as: <%@ page language= "C #" validaterequest= "false" Autoeventwireup= "false" codefile= "Default.aspx.cs" inherits= "Default"%>2, globally modifies the Web. config profile (this does not recommend, Not secure) Open the Web. config file, In the middle, add the following code: If neither of these methods can be resolved, then look down, the problem is: because your current. NET Ifreamwork framework environment is 4.03, open the Web. config configuration file, Middle, plus code: 4, if your website program itself is NET 2.0 environment development, but put in the VS2010 software run, also will appear this situation, you can switch the operation solution to net2.0 can, replacement method see page 3rd step: Click to enter 5, Another approach: The reason is that the transmitted value contains a special hazard symbol, then you can use the Server.HTMLEncode (string) method to encode the string before passing it, so that the dangerous word escapes to ordinary characters. such as Textbox1.text=server.htmlencode (str); Learn more, refer to Microsoft Web page: Http://www.asp.net/whitepapers/request-validation found the original 3 years ago, There is a brief summary of this problem solving method, but not so comprehensive, it seems that experience can make people grow is right, there is a summary of this issue article: VS2005 Debugging Problem Solution collection//--------------------------------------------- Add-------------------------------------------------------------------------------//webconfig

Potentially dangerous Request.Form value detected from the client [workaround]

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.