0

在将(通过 ajax)editor.value() 富 html 文本发布到服务器时,我注意到 Kendo ui editot 存在问题。

在服务器中发布几行带有 html 设计 -> 的内容时,我只得到第一行,直到第一个“ ”。

$("#emailTxtEditor").kendoEditor({
    //encoded: false,
    resizable: true
 });

例如,我采用了这个示例,在设计了一些文本之后,帖子缺少了很多 html 内容......

ps,在服务器中没有模型,因为我不保存此内容。如何解决这个问题?

4

1 回答 1

0

你可以这样做:

$("#emailTxtEditor").kendoEditor(
        {
            tools:
              [
                  "bold",
                  "italic",
                  .....
              ],
            messages: {
                bold: "Bold",
                italic: "Italic",
                underline: "Underline",
                ....
            },
            encoded: false,                
            keyup: function () {
                $("#YourTextbox").val(encodeURIComponent($("#emailTxtEditor").data("kendoEditor").value())),
                $("#YourTextbox").focusin()
            },
            change: function () {
                $("#YourTextbox").val(encodeURIComponent($("#emailTxtEditor").data("kendoEditor").value())),
                $("#YourTextbox").focusin()
            }
        })

在控制器中:

var emailContent = HttpUtility.UrlDecode(Email.EmailContent);//Email is model (for ex)
于 2016-03-22T08:31:42.293 回答