【问题标题】:hmmm CKEditor shows editor but the textbox is still on my page too in asp.net MVC嗯 CKEditor 显示编辑器,但在 asp.net MVC 中文本框仍在我的页面上
【发布时间】:2010-02-27 14:14:14
【问题描述】:

我有这个:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<string>" %>


<script src="<%=Url.Content("~/Scripts/ckeditor/ckeditor.js")%>" type="text/javascript"></script>

<script type="text/javascript">
$(document).ready(function() {
        var CurrName = $(".ckeditor").attr("name");
        CKEDITOR.replace(CurrName, { width: "800" });
});
</script>
<span>Description</span>
<%=Html.TextArea("",Model,10,40,new{Class="ckeditor"}) %>

奇怪的是,编辑器显示得很好,但由于某种原因,页面上仍然存在原始文本框 ???所以我现在有 2 个 EmployeeDescription

有人知道吗?

【问题讨论】:

    标签: asp.net asp.net-mvc asp.net-mvc-2 ckeditor


    【解决方案1】:

    尝试将Class 替换为@class

    <%= Html.TextArea("", Model, 10, 40, new { @class = "ckeditor" }) %>
    

    【讨论】:

    • 那种形式的类实际上在没有@的情况下工作,如果它的小写,结果是我已经将标签更改为editfor而不是文本框,因此2,我工作过度但必须是完成 :-) 将标记为答案,虽然谢谢
    猜你喜欢
    • 1970-01-01
    • 2020-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多