私はMVC3 C#を持っています。ウェブアプリ。プロパティの 1 つは、TextBoxFor コントロールに RTF コントロールを使用します。
@Html.TextAreaFor(model => model.SowDescription,
(object)new
{
rows = 7,
cols = 65,
@class = "celltext2 save-alert attachmentEditor",
disabled = "disabled"
}
attachmentEditor クラスは 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() ヘルパーを使用してエンコード/デコードする方法はありますか?