Как я могу включить предварительный просмотр FCKeditor на сайте ASP.Net?
В этом вопросе Скотт пишет, что можно получить текущий HTML для того, что написано в FCKeditor, используя FCKeditorAPI.__Instances['instanceNameHere'].GetHTML();
Может ли кто-нибудь предоставить пошаговые инструкции о том, как это сделать на странице ASP.NET? Все, что у меня есть в файле.aspx, так это:
<%@ 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>
1 ответ
Решение
В JavaScript
Ну, вы можете сделать это здесь:
<script type="text/javascript">
var oEditor = FCKeditorAPI.GetInstance(’IDFromFCKEditor’);
oEditor.Events.AttachEvent( 'OnSelectionChange', function() {
document.getElementById("PreviewDiv").innerHTML = oEditor.GetHTML(true);
}) ;
</script>
Источник http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/JavaScript_API