Re: Editor in aspx page not returning changed text in IE 8

  •  09-20-2011, 3:32 PM

    Re: Editor in aspx page not returning changed text in IE 8

    Hi LawProgrammer,
     
    In example below, the button does not get the new content and set for label1
     
    <%@ Page Language="C#" %>

    <%@ Register Namespace="CuteEditor" Assembly="CuteEditor" TagPrefix="CE" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <script runat="server">
        protected override void OnLoad(EventArgs e)
        {
            editor1.Text = "I am label1";
            label1.Text = editor1.Text;
            base.OnLoad(e);
        }


        protected void btn_change_Click(object sender, EventArgs e)
        {
            label1.Text = editor1.Text;
        }
    </script>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <CE:Editor ID="editor1" runat="server">
                </CE:Editor>
                <asp:Button ID="btn_change" runat="server" Text="Get editor text" OnClick="btn_change_Click" />
                <asp:Label ID="label1" runat="server"></asp:Label>
            </div>
        </form>
    </body>
    </html>
     
    And in the example below, the button get and set the new content correct.
     
     
    <%@ Page Language="C#" %>

    <%@ Register Namespace="CuteEditor" Assembly="CuteEditor" TagPrefix="CE" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <script runat="server">
        protected override void OnLoad(EventArgs e)
        {
            if (!IsPostBack)
            {
                editor1.Text = "I am label1";
                label1.Text = editor1.Text;
            }

            base.OnLoad(e);
        }


        protected void btn_change_Click(object sender, EventArgs e)
        {
            label1.Text = editor1.Text;
        }
    </script>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <CE:Editor ID="editor1" runat="server">
                </CE:Editor>
                <asp:Button ID="btn_change" runat="server" Text="Get editor text" OnClick="btn_change_Click" />
                <asp:Label ID="label1" runat="server"></asp:Label>
            </div>
        </form>
    </body>
    </html>
     
    Please use the same way on your site. If you still can not get it work, please create an example page which can reproduce this issue and post here, I will check it and get back to you as soon as possible.
     
    Regards,
     
    Ken
View Complete Thread