我怎样才能启用的FCKeditor在ASP.Net现场直播preVIEW? [英] How can I enable live preview for FCKeditor in an ASP.Net site?
问题描述
在以上这个问题,斯科特写道,可以通过使用 FCKeditorAPI .__实例['instanceNameHere']来获取什么写在FCKeditor的当前HTML GetHTML();
有人可以提供关于如何在ASP.NET页面完成这一步一步的说明?所有我目前在.aspx文件到目前为止是这样的:
<%@注册大会=FredCK.FCKeditorV2命名空间=FredCK.FCKeditorV2标签preFIX =FCKeditorV2%GT;
<%@页标题=LANGUAGE =C#...%GT;
< ASP:内容ID =内容1ContentPlaceHolderID =日程地址搜索Maincontent=服务器>
< H2>创建一个新的作品< / H>
<表ID =form1的=服务器>< FCKeditorV2:FCKeditor的ID =FCKeditor1=服务器>
< / FCKeditorV2:FCKeditor的><输入ID =Submit1类型=提交值=提交=服务器/>
< /表及GT;
< / ASP:内容>
在JavaScript的
好了,你可以在这里做到这一点:
<脚本类型=文/ JavaScript的>
变种oEditor = FCKeditorAPI.GetInstance('IDFromFCKEditor');
oEditor.Events.AttachEvent('OnSelectionChange',函数(){
的document.getElementById(previewDiv)的innerHTML = oEditor.GetHTML(真)。
});
< / SCRIPT>
http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/JavaScript_API
Over in this question, Scott writes that it is possible to get the current HTML for what's written in the FCKeditor by using FCKeditorAPI.__Instances['instanceNameHere'].GetHTML();
Could someone provide step-by-step instructions on how to accomplish this in an ASP.NET page? All I currently have so far in the .aspx file is this:
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<%@ Page Title="" Language="C#" ... %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<h2>Create a new piece</h2>
<form id="form1" runat="server">
<FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server">
</FCKeditorV2:FCKeditor>
<input id="Submit1" type="submit" value="Submit" runat="server" />
</form>
</asp:Content>
In javascript
Well you can do this here:
<script type="text/javascript">
var oEditor = FCKeditorAPI.GetInstance(’IDFromFCKEditor’);
oEditor.Events.AttachEvent( 'OnSelectionChange', function() {
document.getElementById("PreviewDiv").innerHTML = oEditor.GetHTML(true);
}) ;
</script>
Source http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/JavaScript_API
这篇关于我怎样才能启用的FCKeditor在ASP.Net现场直播preVIEW?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!