Solved

Print a message after every page-break when printing aspx page

Posted on 2013-11-19
1
492 Views
Last Modified: 2013-11-22
Hello,

When using IE, I can print my web page doing right click on page and selecting Print.

How could I print a message or image after every page-break when printing my aspx page directly to printer?

I know I can produce a page-break after each H2 on the page doing this:

<HEAD>
       <STYLE TYPE="text/css">
           H2 {page-break-before: always}
      </STYLE>
</HEAD>

But how can I print a message or jpg image after a page-break was done?
0
Comment
Question by:miyahira
1 Comment
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 39659437
you'd have to use javascript for this:

<script language="javascript" type="text/javascript">
    function CallPrint(strid) {
        var prtContent = document.getElementById(strid);
        var WinPrint = window.open('', '', 'letf=0,top=0,width=800,height=100,toolbar=0,scrollbars=0,status=0,dir=ltr');
        WinPrint.document.write(prtContent.innerHTML);
        WinPrint.document.close();
        WinPrint.focus();
        WinPrint.print();
        WinPrint.close();
        prtContent.innerHTML = strOldOne;
    }
</script>

Open in new window


this code will put the section in a popup and allow you to print from there.

of course, you also create a print style sheet in CSS, hide the elements you don't want to print, and have a class (for example, named print) applied to all of the controls on your page. Therefore it would just be the need for one button.

see http://code.msdn.microsoft.com/Print-a-specific-part-of-7189b52b for more details
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
#Citrix #Internet Explorer #Enterprise Mode #IE 11 #IE 8
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question