Editor showing data as plain text instead of HTML. It is saving correct formatted test all the way to DB

134 Views Asked by At

I'm facing an issue where I can successfully save HTML text to DB using the Editor. Still, upon loading the exact text (with all the formatting tags), the Editor refuses to format it correctly and displays it as plain text:

@* Background *@
<div class="row mt-3">
    <div class="col-12">
        @Html.LabelFor(m => m.BackgroundConcessionaireContract, "Background of Concessionaire/Contract *", new { @class = "col-12 control-label" })
        <kendo-editor   for="BackgroundConcessionaireContract" style="height:350px" aria-label="editor"
                placeholder="Background of Concessionaire/Contract">
            <tools>...</tools>
        </kendo-editor>
    </div>
</div>

<hr class="cm-hr" />

@* Proposal Details *@
<div id="divProposalDetails" class="row mt-3">
    <div class="col-12">
        @Html.LabelFor(m => m.CommercialTermsDetails, "Commercial Terms Details *", new { @class = "col-12 control-label" })
        <kendo-editor   for="CommercialTermsDetails" style="height:350px" aria-label="editor"
                placeholder="Commercial Terms Details">
            <tools>...</tools>
        </kendo-editor>
    </div>
</div>

<hr class="cm-hr" />

@* Financial Analysis *@
<div class="row mt-3">
    <div class="col-12">
        @Html.LabelFor(m => m.FinancialAnalysis, "Financial Analysis *", new { @class = "col-12 control-label" })
        <kendo-editor   for="FinancialAnalysis" style="height: 350px" aria-label="editor"
                placeholder="Financial Analysis">
            <tools>...</tools>
        </kendo-editor>
    </div>
</div>

In the model, the fields are defined simply as:

public string BackgroundConcessionaireContract { get; set; }
public string CommercialTermsDetails { get; set; }
public string FinancialAnalysis { get; set; }

The output is like this: enter image description here

1

There are 1 best solutions below

0
On

I figured out that I had to set the Encoded parameter/attribute to false for this to work:

<kendo-editor for="CommercialTermsDetails" encoded="false" style="height:350px" aria-label="editor" placeholder="Commercial Terms Details">
</kendo-editor>