简体   繁体   English

Freetextbox有潜在危险的request.form

[英]a potentially dangerous request.form with Freetextbox

I am using a control called FreeTextBox and when i am click on update button i am getting the error "A potentially dangerous Request.Form value was detected from the client (fTxtContent="tyretyeryteyterty...").". 我正在使用一个名为FreeTextBox的控件,当我单击更新按钮时,出现错误“从客户端检测到潜在危险的Request.Form值(fTxtContent =“ tyretyeryteyterty ...”)。”。 and for that i don't want to disable the page level property ie validaterequest to false. 为此,我不想禁用页面级属性,即validaterequest为false。 Is there any good idea to deal with this error. 有什么好主意来解决此错误。

Please Help me ASAP. 请尽快帮助我。

If anyone still needs help with this, setting ValidateRequest to false will work before .NET Framework 4.0. 如果仍然有人需要帮助,将.NET Framework 4.0之前的ValidateRequest设置为false即可。 In 4.0, requests are validated by default. 在4.0中,默认情况下会验证请求。 To disable this functionality, add the following to the element of your web.config: 要禁用此功能,请将以下内容添加到web.config的元素中:

<httpRuntime requestValidationMode="2.0" />

That should fix it. 那应该解决它。 Thanks RobRisner 感谢RobRisner

I am not a big fan of disabling ValidateRequest, but if I am not mistaken, FreeTextBox saves the raw text as HTML. 我不是禁用ValidateRequest的忠实拥护者,但是如果我没有记错的话,FreeTextBox会将原始文本保存为HTML。 So that text might be saved with <p>Your text here</p> which ASP.NET would treat as potentially hazardous. 这样,文本可能会与<p>Your text here</p>一起保存,ASP.NET将其视为潜在危险。 You may have no choice but to turn off validate request on this page that has the component. 您可能别无选择,只能在具有组件的页面上关闭验证请求。

我认为您需要将validaterequest设置为false,因为FreeTextBox试图将HTML发送到服务器,为什么要使用FreeTextBox?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM