Original address: http://zzhi191.blog.163.com/blog/static/1350849520111116518067/
Web development is inevitably more than Ajax technology.
We handle AJAX background pages in ASP. Some people like to use ASPX pages, others like to use ashx pages, compared to the latter processing faster.
But when your environment is. NET 4.0, and the parameters submitted in Ajax happen to have special characters, such as Name=
This will cause an error: A potentially dangerous request.form value has been detected.
At this point we need to modify the Web. config file to add code within the <system.web></system.web> node as follows:
Let the validation mode be. NET 2.0 mode, then ASHX will not error.
Because the validation of 4.0 is enabled before HTTP beginrequest, the requested validation applies to all ASP. NET resources, ASPX pages, ashx pages, Web services, and some HTTP handlers.
Of course, if it is in the ASPX page to report this error is the page header and validation properties, very simple, Google query.
If someone asked some special characters in Ajax how to upload to the background ashx page. For example ABC.ASPX?NAME=AS&CD the name value here is AS&CD instead of as this issue can be viewed in my other blog click here to view
. Net4.0 ashx page Error: Potentially dangerous Request.Form value detected (RPM)