詳細なデータ検証を使用したい。[AllowHtml]
属性が で機能しませんFormCollection
。を使用する以外の方法はありますValidateInput(false)
か?
メタデータ:
[AllowHtml]
[DataType(DataType.MultilineText)]
[Display(Name = "Content")]
public string Content { get; set; }
in edit action:
[HttpPost]
public virtual ActionResult Edit(int id, FormCollection formCollection)
{
var obj = service.Get(id);
if (ModelState.IsValid)
{
UpdateModel(obj, formCollection);
service.Update(obj);
return OnEdited(obj);
}
return View(obj);
}