The client detected a potentially dangerous request. form value with a string such as JavaScript during the recent request.

Source: Internet
Author: User

The client detects potentially dangerous request. Form values. Reasons and Solutions
The client detects potentially dangerous request. Form values. Causes and Solutions
Cause: When a page request contains a string such as HTML or Javascript. ASP. NET considers it a dangerous value and throws a resignation exception. This exception occurs when the WYSIWYG editor (for example, the FCKeditor or freetextbox control) is used on the page.

Solution 1: Add <% PAGE validaterequest = "false" %> to the page.

Solution 2: Modify the <pages> label of the web. config configuration file. <Pages validaterequest = "false">... </pages>. This method removes all page verification functions, so this method is not recommended.

Solution 3: capture exceptions so that you can define the exception prompts by yourself.

Protected void page_error (Object sender, eventargs E)
{
Exception EX = server. getlasterror ();
If (httpcontext. Current. server. getlasterror () is httprequestvalidationexception)
{
Httpcontext. Current. response. Write ("Enter the exception information to be prompted ");
Httpcontext. Current. clearerror ();
}
}

 

 

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.