• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 443
  • Last Modified:

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

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?
1 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now