CuteEditor_OnInitialized(editor) doesn't work when ajax call back in the tab panel

  •  03-24-2010, 11:34 PM

    CuteEditor_OnInitialized(editor) doesn't work when ajax call back in the tab panel


    Hi there,
    I have a cuteeditor in tabpanel of a tabcontainer.
    I use following code to resize the editor. However, for any ajax postback, it will report the following error message. Is there any way to overcome this problem? thx

    error message : Microsoft JScript runtime error: Object doesn't support this property or method


    Partial Class Test3

    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim aa As String = ""

    End Sub

    End Class


    ________________________________________________________________________________________________________________________________
     
     
     
     

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Test3.aspx.vb" Inherits="Test3" %>

    <%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>

    <%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

    Namespace="System.Web.UI" TagPrefix="asp" %>

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

    <!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></title>

     

    </head>

    <body>

    <form id="form1" runat="server">

    <div>

    <asp:ScriptManager ID="ScriptManager1" runat="server">

    </asp:ScriptManager>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">

    <ContentTemplate>

    <asp:Button ID="Button1" runat="server" Text="Button" />

    <cc1:TabContainer ID="TabContainer1" runat="server">

    <cc1:TabPanel runat="server" HeaderText="Surveyors Section" ID="TabPanel1" Height="100%">

    <HeaderTemplate>

    <div>

    123</div>

    </HeaderTemplate>

    <ContentTemplate>

    <div id="div1" style="overflow: auto;">

    asdfsdaf

    </div>

    </ContentTemplate>

    </cc1:TabPanel>

    <cc1:TabPanel runat="server" HeaderText="Surveyors Section" ID="TabPanelSurveyor"

    Height="100%">

    <HeaderTemplate>

    <div>

    Surveyors Section</div>

    </HeaderTemplate>

    <ContentTemplate>

    <div id="divSurveyor" style="overflow: auto;">

    <CE:Editor ID="Editor1" runat="server">

    </CE:Editor>

    </div>

    </ContentTemplate>

    </cc1:TabPanel>

    </cc1:TabContainer>

    </ContentTemplate>

    </asp:UpdatePanel>

    </div>

    </form>

    </body>

    </html>

    <script type="text/javascript">

    var editor1 = document.getElementById('<%= Editor1.ClientID %>');

    function CuteEditor_OnInitialized(editor) {

    if (editor1 != null) {

    editor1.SetHeight(document.documentElement.clientHeight - 70 - 70 - 50);

    }

    }

    window.onresize = function() {

    if (editor1 != null) {

    editor1.SetHeight(document.documentElement.clientHeight - 70 - 70 - 50);

    }

    }

     
     
     
     
     
     
     


     
View Complete Thread