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) enter image description here

this pic below shows detail page blog. problem here stills showing html tags though i've allowed html body property. enter image description here

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

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -