Override Insert Page Break Styling

Last post 10-09-2013, 2:18 PM by CTietgen. 3 replies.
Sort Posts: Previous Next
  •  10-09-2013, 12:01 PM 78079

    Override Insert Page Break Styling

    Hello,

     

    I would like to know if I can override the HTML inserted for a Page Break? I would like to change the style of the page break line (DIV) by making it a little taller with the text "- Page Break -" in the DIV. This would make the page break more visible for our users.

     

    Thanks,

    Chris 

  •  10-09-2013, 1:16 PM 78081 in reply to 78079

    Re: Override Insert Page Break Styling

    Hi CTietgen,

     

    You can catch the page break command and change it to your own logic, like the example below. It will insert the <div>- Page Break -</div> when you click on the page break button.

     

    1. <%@ Page Language="C#" %>  
    2.   
    3. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>  
    4.   
    5.   
    6. <html>  
    7. <head>  
    8.     <title>example </title>  
    9. </head>  
    10. <body>  
    11.     <form id="Form1" runat="server">  
    12.         <CE:Editor ID="Editor1" runat="server">  
    13.         </CE:Editor>  
    14.         <script type="text/javascript">  
    15.         function CuteEditor_OnCommand(editor,command,ui,value)  
    16.          {  
    17.             //handle the command by yourself  
    18.            if(command=="InsertPageBreak")  
    19.            {  
    20.                 editor.PasteHTML("<div>- Page Break -</div>");  
    21.                 return true;  
    22.            }  
    23.         }  
    24.         </script>  
    25.     </form>  
    26. </body>  
    27. </html>  
     

    Regards,

     

    Ken 

     

  •  10-09-2013, 1:43 PM 78083 in reply to 78081

    Re: Override Insert Page Break Styling

    Awesome!

     

    I take it that your sample would work in Classic ASP? We're in the process of switching to ASP.NET, but we aren't converting every page right now.

  •  10-09-2013, 2:18 PM 78084 in reply to 78083

    Re: Override Insert Page Break Styling

    Just to follow up, I got it working in Classic ASP. Again, thanks for your help.
View as RSS news feed in XML