简体   繁体   中英

Adding a footer to each printed page from an ASP.NET website

I am working with an existing ASP.NET/C# website that has a new requirement: when a user prints a page from the website, each printed page must contain a footer with a set text. That is, if the HTML table will require two printed pages, each page must contain the footer.

I have read how to add to my CSS file for a print-only scenario, but what I haven't found is how to do the pagination to know when to add in the footer.

The content that is being is printed is contained within an asp:Table.

Thanks in advance for your time and any assisitance you can provide.

Sorry to be the one to tell you this, but...

This can't be done via html, css, javascript, or anything you will have control over.

If you need this type of functionality, you're going to need to look at other options, such as a Word mail merge or Crystal reports, or SQL Server Reporting Services.

Edit

Sorry. I should have said:

"You can't do this reliably for all browsers". For consistent results (which is what we all want in most cases, isn't it?) you're going to need to look at other options, such as a Word mail merge or Crystal reports.

You can use a block-element which you can position with position: fixed . I came across this article from 2004 which details that technique. Unfortunately back then support was very limited but this situation should be much better now. I definitely know that this works in IE 8 (having clicked through each of the 7k+ CSS tests ...).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM