Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

CK Editor Not Working with MultiView and UpdatePanel

$
0
0

Very strange issue with CK Editor. It works fine with update panel in a single page but When use the MultiView control it doesn't work.

I searched for the solution but didn't found any solution.

Downloaded latest CK editor files from: http://ckeditor.com/

Code Below. 

<%@ Page Title="CK Editor Demo" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ck.aspx.cs" Inherits="ck" %><asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server"><script src="ckeditor/ckeditor.js"></script></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="Server"><section class="featured"><div class="content-wrapper"><hgroup class="title"><h1><%: Title %>.</h1></hgroup><p>
                CK Editor Demo with Update Panel</p></div></section></asp:Content><asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="Server"><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><asp:MultiView ID="mvEditor" runat="server" ActiveViewIndex="0"><asp:View ID="v1" runat="server"><asp:Button ID="btnAdd" runat="server" Text="Add New" OnClick="btnAdd_Click" /><asp:Button ID="btnEdit" runat="server" Text="Edit" OnClick="btnEdit_Click" /></asp:View><asp:View ID="v2" runat="server"><asp:Button ID="btnBack" runat="server" Text="Back" OnClick="btnBack_Click" /><asp:TextBox ID="txtEditor1" runat="server" TextMode="MultiLine"></asp:TextBox></asp:View></asp:MultiView><script type="text/javascript">
                $(function () {
                    CKEDITOR.replace('<%= txtEditor1.ClientID %>', { width: '100%', height: '200px', toolbar: "Basic" });
                });</script></ContentTemplate></asp:UpdatePanel></asp:Content>

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        { }
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        mvEditor.ActiveViewIndex = 1;
        txtEditor1.Text = "";
    }
    protected void btnEdit_Click(object sender, EventArgs e)
    {
        mvEditor.ActiveViewIndex = 1;
        txtEditor1.Text = "Bingoo!!!";
    }
    protected void btnBack_Click(object sender, EventArgs e)
    {
        txtEditor1.Text = "";
        mvEditor.ActiveViewIndex = 0;        
    }

Any help must be appreciated.


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>