Lost postback event when setting the Autoconfig property

  •  09-08-2009, 6:10 AM

    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
View Complete Thread