I have an existing class in an MVC4 project (also using EF 4) that I need to set the [AllowHtml] DataAnnotation on. I already have annotations on several of the properties in this class (i.e. Required, Display) that are working fine. The appropriate libraries are included:
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
Still, I am getting an error message:
Cannot resolve symbol [AllowHtml]
Here is the code. The first two annotations are working. The third is not. I tried setting it separately from the others, that made no difference. What am I missing?
[Display(Name = "Title"), Required, AllowHtml]
public string Title { get; set; }
AllowHtml
is in the System.Web.Mvc namespace
http://msdn.microsoft.com/en-us/library/system.web.mvc.allowhtmlattribute(v=vs.98).aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With