Solved

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

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

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Internet is a big network which is formed by connecting multiple small networks.It is a platform for all the users which are connected to it.Internet act as platform in different fields. Such as: Internet  as a collaboration platform. Internet  as…
This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
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.

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now