从客户端中检测到有潜在危险的 Request.Form 值

今天将一个以前.net framework v1.0的项目升级到v2.0的时候居然出错了.出错信息如下:
从客户端(txtSummary=”<P><STRIKE>sdfasdf</…”)中检测到有潜在危险的 Request.Form 值。

说明: 请求验证过程检测到有潜在危险的客户端输入值,对请求的处理已经中止。该值可能指示危及应用程序安全的尝试,如跨站点的脚本攻击。通过在 Page 指令或 配置节中设置 validateRequest=false 可以禁用请求验证。但是,在这种情况下,强烈建议应用程序显式检查所有输入。
解决办法如下:

<%@ Page language=”c#” Codebehind=”add.aspx.cs” ValidateRequest=”false” Inherits=”PRFP.add” %>
This entry was posted in ASP.NET and tagged , , . Bookmark the permalink.

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word