公司网站开发外包公司,个人信息页面设计漂亮的网站,电脑做网站用什么软件,教育培训类网站设计今天手下有个问#xff1a;当用户填写提交后#xff0c;再次显示提交页面时#xff0c;该页面的UEditor编辑器需要设置成不可编辑#xff0c;怎么实现#xff1f;
可以用后台调用前台js的方式实现#xff1a;
例如#xff1a;
前台页面#xff1a; div style当用户填写提交后再次显示提交页面时该页面的UEditor编辑器需要设置成不可编辑怎么实现
可以用后台调用前台js的方式实现
例如
前台页面 div style请将答案写到下面/divasp:HiddenField IDmyEditorHidden runatserver /div styletext-align:left;padding-top:5px;%--文本编辑器--%div idmyEditor stylewidth:100%;height:150px; /div/div
前台实现编辑器初始化和内容传递js:
script typetext/javascriptvar ue UE.getEditor(myEditor, {toolbars: [[ undo, redo, |,bold, italic, underline, fontborder, strikethrough, superscript, subscript, removeformat, formatmatch, autotypeset, blockquote, pasteplain, |, forecolor, backcolor, insertorderedlist, insertunorderedlist, selectall, cleardoc, |,rowspacingtop, rowspacingbottom, lineheight, |,customstyle, paragraph, fontfamily, fontsize, |,directionalityltr, directionalityrtl, indent, |,justifyleft, justifycenter, justifyright, justifyjustify, |, touppercase, tolowercase, |,link, unlink, anchor, |, imagenone, imageleft, imageright, imagecenter, |,simpleupload, insertimage, scrawl, insertframe, insertcode, pagebreak, template, background, |,horizontal, date, time, spechars, snapscreen, wordimage, |,inserttable, deletetable, insertparagraphbeforetable, insertrow, deleterow, insertcol, deletecol, mergecells, mergeright, mergedown, splittocells, splittorows, splittocols, charts, |,print, preview, searchreplace, help, drafts]],allHtmlEnabled: false,//提交到后台的数据是否包含整个html字符串autoHeightEnabled: false,autoFloatEnabled: true,allowDivTransToP: false//阻止div标签自动转换为p标签});function insertUedit() {ue.ready(function () {// alert(tt);var result document.getElementById(%myEditorHidden.ClientID %).value;UE.getEditor(myEditor).setContent(result, false);UE.getEditor(myEditor).setDisabled();console.log(result);});}/script
上面的UE.getEditor(myEditor).setDisabled();即设置该编辑器不可编辑。
后台调用前台的js实现配置参数 ClientScript.RegisterStartupScript(ClientScript.GetType(), myScript, scriptwindow.onloadfunction(){insertUedit();}/script);//调用前台的js