Classic editor showing HTML tags

2 posts, 0 answers
  1. Mike
    Mike avatar
    17 posts
    Member since:
    Feb 2015

    Posted 26 Apr 2015 Link to this post

    This is the value that's in the database and being passed to the view:

    <p>this is a paragraph</p>

     This is what is showing in the Editor:

     <p>this is a paragraph</p>

    I've searched online for the solution, and found that I need to set encoded = false in the editor, and [AllowHtml] attribute to field in the class. I did that, but am still having the issue. 

    Here is the code in the view for the editor -- the first line appends a text area into a div:


            $("#divParagraphs").append('<div class="search-box"><div class="row"><div class="col-md-12">Paragraph:</div></div><div class="row"><div class="col-md-12"><textarea class="Paragraph" id=' + id + '></textarea><input type="hidden" id=' + id + '_id value=' + pid + ' /></div></div></div>');

             $("#" + id).kendoEditor({
                encoded: false,
                tools: [

     I'm out of ideas :-) Please help.




  2. Dimo
    Dimo avatar
    8404 posts

    Posted 28 Apr 2015 Link to this post

    Hi Mike,

    The Razor view engine encodes HTML strings automatically. Please make sure that the value, which is passed to the Editor, is not double encoded.

    Also, keep in mind that a similar issue can occur during validation:

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top