我将 Kendo.EditorFor 用于文本框,但在视图中。它显示来自编辑器的 htmls 标签,这是我的控制器:
public ActionResult Create(OpininonModel opininonmodel)
{
var addOpinion =
new OpininonModel
{
Title=opininonmodel.Title,
Content=Server.HtmlDecode(opininonmodel.Content),
Id=opininonmodel.Id,
IdUser=user,
};
db.Opinions.Add(addOpinion);
db.SaveChanges();
return RedirectToAction("Index");
}
我<strong>123123</strong>
认为。我应该HtmlDecode
在其他地方还是?
我在我的视图中试过这个:
@(Html.Kendo().EditorFor(model => model.Content).Encode(false))
但这给了我错误:
A potentially dangerous Request.Form value was detected from the client