Opened 6 years ago

Closed 6 years ago

#8089 closed Bug (fixed)

asp.net Editor disappears on ajax postback

Reported by: Wiktor Walc Owned by: kaga
Priority: Normal Milestone: CKEditor 3.6.2
Component: Server : ASP.Net Version:
Keywords: Cc:

Description

Here's a simple sample:

<%@ 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>

When any ajax postback occurs the editor disappears.

Is this a known problem and are there any workarounds?

Reported in http://cksource.com/forums/viewtopic.php?t=22645

Attachments (5)

8089.patch (3.4 KB) - added by kaga 6 years ago.
8089_update.patch (3.7 KB) - added by kaga 6 years ago.
Default.aspx (2.3 KB) - added by kaga 6 years ago.
Simple example to show problem described by BoouM in the same post.
8089_v2.patch (3.7 KB) - added by kaga 6 years ago.
Path with solution the problem shown in the Default.aspx
validator.aspx (788 bytes) - added by Wiktor Walc 6 years ago.
Sample file to reproduce issue reported by shih527

Download all attachments as: .zip

Change History (11)

Changed 6 years ago by kaga

Attachment: 8089.patch added

comment:1 Changed 6 years ago by kaga

Owner: set to kaga
Status: newreview

The problem occurred only if the validation failed.

comment:2 Changed 6 years ago by Wiktor Walc

Status: reviewreview_passed

Looks good, but note: the change in _dev/msajax.js is wrong. There should be:

if (inUpdatePanel && Page_IsValid) { 

instead of

if (e && Page_IsValid) { 

comment:3 Changed 6 years ago by Wiktor Walc

comment:4 Changed 6 years ago by Wiktor Walc

Resolution: fixed
Status: review_passedclosed

Fixed with [7258].

Changed 6 years ago by kaga

Attachment: 8089_update.patch added

comment:5 Changed 6 years ago by kaga

Resolution: fixed
Status: closedreopened

Pleas check one more time. I found a little bug. Bug appears on page without any validation - in this case Page_IsValid is undefined

Last edited 6 years ago by kaga (previous) (diff)

Changed 6 years ago by kaga

Attachment: Default.aspx added

Simple example to show problem described by BoouM in the same post.

Changed 6 years ago by kaga

Attachment: 8089_v2.patch added

Path with solution the problem shown in the Default.aspx

Changed 6 years ago by Wiktor Walc

Attachment: validator.aspx added

Sample file to reproduce issue reported by shih527

comment:6 Changed 6 years ago by Wiktor Walc

Milestone: CKEditor 3.6.2
Resolution: fixed
Status: reopenedclosed

Ok, the updated patch looks good, fixed with [7282]. The other issue that I've mentioned in previous comment, although also related to validation, seems like a separate issue. I have reported it in #8381

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy