我有一个文本区域,我已经应用了ckeditor类。我希望文本区域为必填字段。我添加了视图的代码。我怎样才能实现它? 尝试了CKEditor and ASP.Net MVC 3 RequiredAttribute的几个解决方案,但没有结果。
@Html.LabelFor(model => model.faq_answer)
@Html.TextAreaFor(model => model.faq_answer, new { @class = "ckeditor form-control", @id = "faq_answer" })
@Html.ValidationMessageFor(model => model.faq_answer, "", new { @class = "text-danger" })
我的模型属性
[Display(Name ="Answer")]
[Required(ErrorMessage ="Please Enter Answer")]
public string faq_answer { get; set; }