Re: Can't update H1 tags in config files

  •  08-11-2010, 8:49 PM

    Re: Can't update H1 tags in config files

    Please try the following code:
    <%@ Page Language="C#" %>
    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
    <html>
    <head>
    </head>
    <body>
        <form id="Form1" runat="server">
        <CE:Editor ID="Editor1" EditorWysiwygModeCss="../example.css" ThemeType="Office2007"
            EditCompleteDocument="true" AllowPasteHtml="false" runat="server">
        </CE:Editor>
        <br>
        <asp:Button ID="btnUpdate" OnClick="Submit" runat="server" Text="Submit"></asp:Button><br />
        <asp:TextBox ID="textbox1" runat="server" TextMode="MultiLine" Height="250px" Width="750px"
            Font-Name="Arial"></asp:TextBox>
        </form>
    </body>
    </html>
    <script runat="server">
      
        void Page_Load(object sender, System.EventArgs e)
        {
            if (IsPostBack)
            {
                Editor1.SaveFile("document.htm");
                textbox1.Text = Editor1.Text;
            }
            else
            {
                Editor1.Text = "123";
            }
        }
        public void Submit(object sender, System.EventArgs e)
        {
            Editor1.SaveFile("document.htm");
            textbox1.Text = Editor1.Text;
        }
    </script>
    <script type="text/javascript">
        function CuteEditor_FilterHTML(editor, code) {
            test1 = code.split("<h1>").join("<h1 style='color:red;padding:0;margin:0'>");
            test2 = test1.split("<h2>").join("<h2 style='color:red;padding:0;margin:0'>");
            test3 = test2.split("<h3>").join("<h3 style='color:red;padding:0;margin:0'>");
            test4 = test3.split("<h4>").join("<h4 style='color:red;padding:0;margin:0'>");
            return test4;
        }
        function CuteEditor_FilterCode(editor, code) {
            test1 = code.split("<h1>").join("<h1 style='color:red;padding:0;margin:0'>");
            test2 = test1.split("<h2>").join("<h2 style='color:red;padding:0;margin:0'>");
            test3 = test2.split("<h3>").join("<h3 style='color:red;padding:0;margin:0'>");
            test4 = test3.split("<h4>").join("<h4 style='color:red;padding:0;margin:0'>");
            return test4;
        }      
     </script>
    Regards,
    Eric

     

View Complete Thread