【发布时间】:2018-07-08 21:56:00
【问题描述】:
我想将 CKEditor 集成到我的 MVC Core 2.0 应用程序中,在以前的版本中,我通过将 [AllowHTML] 数据注释添加到我的字符串属性来使用它。但在 ASP.Net Core 中,我找不到将 HTML 插入字符串输入的正确方法。
我在 ASP.Net MVC 5 中的代码
[AllowHtml]
[DataType(DataType.MultilineText)]
public string Profile { get; set; }
但在 ASP.Net Core 2.0 [AllowHtml] 中不起作用。我在谷歌搜索但找不到正确的解决方案,除了这个链接https://docs.microsoft.com/en-us/aspnet/core/security/cross-site-scripting
[DataType(DataType.MultilineText)]
public string Profile { get; set; }
我真的被这个问题困住了,需要 .Net 专家的帮助,谢谢。
【问题讨论】:
-
其实我想在我的应用程序中集成CKEDITOR。和 @Html.TextAreaFor(item => item.Profile, new { @id = "editor1" }) 正确呈现 CKEDITOR 但是当我使用 HTML Tag Helpers 它不呈现 CKEDITOR
-
那么是什么阻止了你?
-
CKEDITOR 在我使用公共字符串 Profile { get; 时不起作用放; }
-
什么不起作用?
标签: asp.net-mvc asp.net-core asp.net-core-mvc asp.net-core-2.0