gpt4 book ai didi

asp.net-mvc-3 - MVC3 C# Potentially dangerous request 错误

转载 作者:行者123 更新时间:2023-12-02 22:15:49 27 4
gpt4 key购买 nike

我有一个 MVC3 C#。网络应用程序。我们的一个属性为我们的 TextBoxFor 控件使用了一个 RTF 控件:

                @Html.TextAreaFor(model => model.SowDescription,
(object)new
{
rows = 7,
cols = 65,
@class = "celltext2 save-alert attachmentEditor",
disabled = "disabled"
}

附件编辑器类使用 CkEditor。因此,在控件中嵌入了用于粗体、斜体等的 html 标记。用户将一些数据粘贴到此 TextArea 中,我们收到此错误:

A potentially dangerous Request.Form value was detected from the client (SowDescription="<br />  <br />  <u><..."). ******** 

我们在其他情况下使用 HttpUtility.HtmlDecode,但在 Html.TextAreFor() 帮助程序中使用它会出现此错误:

Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.

关于如何使用 Html.TextAreaFor() 帮助程序编码/解码的任何想法?

最佳答案

尝试使用 [AllowHtml] 属性装饰 SowDescription viewmodel 属性。

关于asp.net-mvc-3 - MVC3 C# Potentially dangerous request 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14489853/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com