How do I handle header and footer files in the MasterPage in ASP.NET 2.0?

Posted on 2007-07-22
Last Modified: 2013-11-07
In my Masterpage I have a header placeholder like this: <asp:contentplaceholder id="HeaderPlaceHolder1" runat="server" />. I wanted to know how I can include a another aspx file in this section, like ASP's <!--#INCLUDE FILE="header.asp"-->. How do I do this with ASP.NET so my header is in a separate file instead of coded all over the place?
Question by:bemara57
    1 Comment
    LVL 10

    Accepted Solution

    This is very simple with .NET 2.0. You build your header and footer as ascx (controls) and on the master page you design where thery are gona be placed and just drag and drop them one by one . Since you have it in your master page any other pages you create  they will have same header and footer.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    745 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

    14 Experts available now in Live!

    Get 1:1 Help Now