Solved

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

Posted on 2013-11-19
1
491 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

803 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