c# - AllowHtml attribute doesn't work -
i'm trying implement tiny mce text editor create
page. i've used [allowhtml]
attribute body
property still doesn't work. detail view blog still showing html tags.
this blog entity class.
public class blog { public int id { get; set; } [required] public string title { get; set; } [allowhtml] [required] [displayname("content")] public string body { get; set; } [displayname("created on")] [datatype(datatype.date)] [required] public datetime created { get; set; } }
the pic below shows create blog page (which shows have tinymce implemented property , working)
this pic below shows detail page blog. problem here stills showing html tags though i've allowed html body
property.
allowhtml attribute helps model binding , not validating(white listing html tags) against html tags . not thing ui.
to display text value , not html encode it, can use @html.raw(model.property)
Comments
Post a Comment