- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 tinymce 编辑器
到具有确切 ID 的文本区域。它在页面加载时工作正常。但是,当我单击 asp 按钮“保存”时,回发以将数据保存在数据库中,事件编辑器变为空并且不保留其值。如何克服这个问题?
我在 pageload 中的 tinyMce 初始化代码是
tinyMCE.init({
mode: "exact",
elements : "divLabTemplateTree",
encoding: "xml",
convert_urls: false,
theme: "advanced",
width:"300",
height:"400",
skin : "o2k7",
plugins: "spellchecker,pagebreak,style,layer,table,advhr,advimage,advlink,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,paste,directionality,fullscreen,visualchars,nonbreaking,xhtmlxtras",
extended_valid_elements: "iframe[src|width|height|name|align]",
theme_advanced_buttons1: "spellchecker,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect,|,print,fullscreen",
theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3: "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,media,advhr,|",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_path_location: "bottom",
theme_advanced_resizing: true,
theme_advanced_resize_horizontal: false,
dom_loaded : 1,
theme_advanced_styles: "Link to Image: lightbox;Image Right Border: rightbordered;Image Left Border: leftbordered;Darker Text: darker",
setup: function (ed) {
ed.onSaveContent.add(function (i, o) {
o.content = o.content.replace(/'/g, "&apos");
});
ed.onInit.add(function(ed) {
tinyMCE.execCommand("mceAddControl", true, "divLabTemplateTree");
});
}
});
我正在设置它的值
if(tinyMCE.activeEditor != null)
{
tinyMCE.activeEditor.setContent("bbbbbbbbbbbbbbb");
}
最佳答案
当页面初始化时,tinyMCE.activeEditor 为空,直到用户明确点击进入编辑器。
这里推荐使用tinymce.get('your_editor_id')
。您的编辑器等于为其初始化编辑器的文本区域 ID。如果此文本区域(或其他 html 源 elmenent)没有 id,则 content
将用作默认值。
关于c# - tinyMce activeeditor 在回发时为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16979660/
我有一个里面 在 GridView 中:
两个问题: 在回发时,当用户单击“提交”时,如何将错误消息添加到验证摘要中? 是否也可以使用内置的 .net 验证控件突出显示特定文本框? 最佳答案 动态创建 CustomValidator 控件并将
我的 Controller 用一个列表填充我的模型,该列表包含出现在我 View 中的 DropDownList 中的 strings。当 View 回发到我的 Controller 时,该列表突然为
我创建了两个输入框,并设置了 JavaScript,以便在达到最大长度时自动聚焦下一个框。它工作正常。但是当触发任何回发事件时,这些值变得清晰。我将 runat="server"放在输入框上,然后输入
我正在开发 asp.net 4.0(Web 表单),每当页面回发以验证凭据时,我都会在登录页面上遇到错误,它会显示以下错误。 Sys.WebForms.PageRequestManagerServer
我目前正在开发一个在 Sharepoint 中运行的 ASP.Net 网站。在解决问题之前,让我先给您一些背景信息。 我开发了 UserControl,然后将其添加为共享点页面上的 Web 部件。其中
我是一名优秀的程序员,十分优秀!