【问题标题】:How to make Telerik Editor Control Readonly?如何使 Telerik Editor 控件只读?
【发布时间】:2013-05-05 03:42:01
【问题描述】:

我已经在我的网页中实现了 Telerik Editor 控制。谁能告诉我如何使它只读。我只是想阻止用户在编辑器中输入任何内容。

下面的代码--

 @{ Html.Telerik().Editor()
       .Name("Content")
       .HtmlAttributes(new { style = "height:150px;"})
       .Encode(true)
       .Tools(tools => tools
           .Clear()
           .Bold().Italic().Underline().Strikethrough().Subscript().Superscript().Separator()
           .FontName().FontSize()
           .FontColor().BackColor().Separator()
           .JustifyLeft().JustifyCenter().JustifyRight().JustifyFull().Separator()
           .InsertUnorderedList().InsertOrderedList().Separator()
           .Indent().Outdent().Separator()
           .Break()).Render();  
                            }

请尽快帮助我..

【问题讨论】:

    标签: asp.net asp.net-mvc-3 razor telerik


    【解决方案1】:

    您可以通过 javaScript 禁用富文本编辑器。检查下面的代码。

      var editorInfo = $("#Content").data("tEditor");
            editorInfo.body.disabled = true;
    

    【讨论】:

      【解决方案2】:

      很遗憾,目前这是不可能的。您需要做的是将IFRAMEDIV 中的文本呈现为典型的HTML 元素,然后将元素的样式设置为与您的编辑器相似(高度、边框、背景等)。在用户看来,它将被“禁用”。

      【讨论】:

      • @SurajKMad 如果您觉得这有帮助,请标记为回答和/或点赞。谢谢!
      猜你喜欢
      • 2017-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-07
      • 1970-01-01
      • 2014-12-10
      相关资源
      最近更新 更多