<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ckTest.aspx.cs" Inherits="CLGHR.ckTest" %> <%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>CKEditor Validation Test</title> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="SM1" runat="server" EnablePartialRendering="true"></asp:ScriptManager> <div> <asp:UpdatePanel runat="server" ID="UP1" UpdateMode="Conditional"> <ContentTemplate> <p> Title: <br /> <asp:TextBox ID="TB_Title" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RFV_Title" runat="server" ControlToValidate="TB_Title" ErrorMessage="Title is required" ValidationGroup="content">*</asp:RequiredFieldValidator> </p> <p> <CKEditor:CKEditorControl ID="TB_Content" runat="server"></CKEditor:CKEditorControl> </p> <p> <asp:Button ID="Btn_Submit" runat="server" ValidationGroup="content" Text="Submit" onclick="Btn_Submit_Click" /> </p> </ContentTemplate> </asp:UpdatePanel> </div> </form> </body> </html>
Wed, 06/01/2011 - 11:29
#1

Re: asp.net Editor disappears on ajax postback
ticket 8089
OK
OK
KO
Keep it simple!
The update panel has a pageLoad() javascript function that gets called after a postback. You can use this event to replace the intance of the ckeditor. Assuming that the html for the editor uses a runat server like this
you can get the rendered tag name using the page source.
function pageLoad(){
CKEDITOR.replace("ctl00_ContentPlaceHolder1_myeditor_myeditor");
}