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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ppuniversal
    New Member
    • Feb 2007
    • 52

    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
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    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:scrol l". This will display the content inside the panel and allow the user to scroll through the content...keepi ng your header and footer in place.

    Eg:
    [code=asp]
    <asp:Panel ID="Header" runat="server"> </asp:Panel>

    <asp:Panel ID="Content" runat="server" style="overflow :scroll"></asp:Panel>

    <asp:Panel ID="Footer" runat="server"> </asp:Panel>
    [/code]

    -Frinny

    Comment

    • nato24
      New Member
      • Jul 2008
      • 1

      #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.

      Comment

      • ppuniversal
        New Member
        • Feb 2007
        • 52

        #4
        Originally posted by nato24
        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

        Comment

        • ppuniversal
          New Member
          • Feb 2007
          • 52

          #5
          Originally posted by Frinavale
          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:scrol l". This will display the content inside the panel and allow the user to scroll through the content...keepi ng your header and footer in place.

          Eg:
          [code=asp]
          <asp:Panel ID="Header" runat="server"> </asp:Panel>

          <asp:Panel ID="Content" runat="server" style="overflow :scroll"></asp:Panel>

          <asp:Panel ID="Footer" runat="server"> </asp:Panel>
          [/code]

          -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

          Comment

          Working...