Lost postback event when setting the Autoconfig property

Last post 09-10-2009, 11:22 AM by Adam. 2 replies.
Sort Posts: Previous Next
  •  09-08-2009, 6:10 AM 55438

    Lost postback event when setting the Autoconfig property

    Was mhonaker's problem ever solved? 
    http://cutesoft.net/forums/thread/30813.aspx
     
    The problem is that after I set the AutoConfig property of the editor the save-button doesn't work until the second click. Here is an example where I use radiobuttons to set the AutoConfig property and shows a Label with text 'save' on postback event.
     
    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="TestAutoConfig.aspx.vb"
        Inherits="nsManager.TestAutoConfig" %>

    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
    <!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>
            <table>
                <tr>
                    <td valign="bottom">
                        <asp:RadioButton ID="radioStandard" runat="server" Checked="true" GroupName="EditorConfig"
                            Text="compact" AutoPostBack="true" TextAlign="Right"></asp:RadioButton>
                        <asp:RadioButton ID="radioAdvanced" runat="server" GroupName="EditorConfig" Text="full"
                            AutoPostBack="true" TextAlign="Right"></asp:RadioButton>
                    </td>
                </tr>
            </table>
            <br />
            <div runat="server" id="divCuteEditor">
                <CE:Editor runat="server" ID="myCuteEditor" >
                </CE:Editor>
                <asp:Label runat ="server" Text="save" Visible ="false" ID="save"></asp:Label>
            </div>
            <br />
        </div>
        </form>
    </body>
    </html>
     
    Code behind:
     
    Public Partial Class TestAutoConfig
        Inherits System.Web.UI.Page


        Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
            If radioStandard.Checked Then
                myCuteEditor.AutoConfigure = CuteEditor.AutoConfigure.Compact
            Else
                myCuteEditor.AutoConfigure = CuteEditor.AutoConfigure.Full
            End If
        End Sub


        Protected Sub myCuteEditor_PostBackCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs) Handles myCuteEditor.PostBackCommand
            save.Visible = True
        End Sub

        Protected Sub radioAdvanced_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles radioAdvanced.CheckedChanged
            save.Visible = False
            If radioStandard.Checked Then
                myCuteEditor.AutoConfigure = CuteEditor.AutoConfigure.Compact
            Else
                myCuteEditor.AutoConfigure = CuteEditor.AutoConfigure.Full

            End If
        End Sub

        Protected Sub radioStandard_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles radioStandard.CheckedChanged
            save.Visible = False
            If radioStandard.Checked Then
                myCuteEditor.AutoConfigure = CuteEditor.AutoConfigure.Compact
            Else
                myCuteEditor.AutoConfigure = CuteEditor.AutoConfigure.Full

            End If
        End Sub
    End Class
     
    Please help me with this problem. I have found several posts in the forum with similar problem but never a solution that works.
     
    //Clara
  •  09-10-2009, 7:58 AM 55531 in reply to 55438

    Re: Lost postback event when setting the Autoconfig property

    Can somebody help?
  •  09-10-2009, 11:22 AM 55539 in reply to 55438

    Re: Lost postback event when setting the Autoconfig property

     
    We tried the above example. It works fine. I don't think it's a bug of Cute Editor. Please check your own code. The source code of the above example can be found in the download package.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML