468,514 Members | 1,625 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,514 developers. It's quick & easy.

How to generate multipage Header and Footers using ASP.NET on web pages.

Hi,
I am developing an application in ASP .NET where I have to generate a Header and a Footer on my web pages. The issue is that, these headers and footers need to be dynamically placed on the page. For example, if the page length is 1 page, there will be only 1 header and 1 footer. But if the page length is larger, and when we do the print/print preview of the page and it goes to say more than 1 page, then I need the headers and footers on all the pages.

In abstract, I need the headers and footers on all the pages depending on the length of the page generated.

I am developing the application in ASP.NET 2.0.

Any help or suggestion will be appreciated.

Thanks
Pawan
Jul 24 '08 #1
4 2627
Frinavale
9,735 Expert Mod 8TB
I'm not sure if you're Printing the page and need these headers and footers to appear on each of the printed pages or if you just want a header and footer to appear on your page.


If you just want a header and a footer on the page, I would place the contents of the page in a panel that has the css "overflow:scroll". This will display the content inside the panel and allow the user to scroll through the content...keeping your header and footer in place.

Eg:
Expand|Select|Wrap|Line Numbers
  1. <asp:Panel ID="Header" runat="server"></asp:Panel>
  2.  
  3. <asp:Panel ID="Content" runat="server" style="overflow:scroll"></asp:Panel>
  4.  
  5. <asp:Panel ID="Footer" runat="server"></asp:Panel>
  6.  
-Frinny
Jul 24 '08 #2
nato24
1
You might want to look at doing a simple screen css using the page-break-after style. Only show header and footer on print.
Jul 25 '08 #3
You might want to look at doing a simple screen css using the page-break-after style. Only show header and footer on print.
Thanks ....
How is this possible....
Can you provide me a more insight to this.
I need to print the header and footer on all pages I print.
Thanks Pawan
Jul 28 '08 #4
I'm not sure if you're Printing the page and need these headers and footers to appear on each of the printed pages or if you just want a header and footer to appear on your page.


If you just want a header and a footer on the page, I would place the contents of the page in a panel that has the css "overflow:scroll". This will display the content inside the panel and allow the user to scroll through the content...keeping your header and footer in place.

Eg:
Expand|Select|Wrap|Line Numbers
  1. <asp:Panel ID="Header" runat="server"></asp:Panel>
  2.  
  3. <asp:Panel ID="Content" runat="server" style="overflow:scroll"></asp:Panel>
  4.  
  5. <asp:Panel ID="Footer" runat="server"></asp:Panel>
  6.  
-Frinny

Thanks ....
I need to print the header and footer on all pages I print.
The logic you are saying will have only 1 header and 1 footer, but I need according to the page. If the page will be printed on 1 page, then 1 set of header and footer. and it will depend on the number of pages...this is just like we have header and footers on word document !!
Thanks Pawan
Jul 28 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by Fred | last post: by
5 posts views Thread by Maileen | last post: by
4 posts views Thread by stevesj | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.