我面临一个问题,我可以使用编辑器成功地将HTML文本保存到DB。尽管如此,在加载确切的文本(带有所有格式标签)时,编辑器拒绝正确格式化它,并将其显示为纯文本:
@* 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>在模型中,字段被简单地定义为:
public string BackgroundConcessionaireContract { get; set; }
public string CommercialTermsDetails { get; set; }
public string FinancialAnalysis { get; set; }输出如下:

发布于 2022-10-25 15:21:13
我发现必须将编码的参数/属性设置为false,这样才能正常工作:
<kendo-editor for="CommercialTermsDetails" encoded="false" style="height:350px" aria-label="editor" placeholder="Commercial Terms Details">
</kendo-editor>https://stackoverflow.com/questions/74131116
复制相似问题