I have a MasterPage in ASP.NET that creates consistent layout for the pages of my application but there are some pages that are put in separate file so it doesn't have a MasterPage.
I also have a separate file page WACHeader.ascx for header.
So what I want to do is put a common header or the common lay out to the pages that are placed in separate file.
How can I add the MasterPage in the separate file page without getting an error?
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="TestLogin.aspx.vb" Inherits="ECM.TestLogin" %>
Because every time I add
MasterPageFile="~/masterpage/ECM_MasterPage.master"
I get an error
Content controls have to be top-level controls in a content page or a nested master page that references a master page.
How can I put my common header?
What I have tried:
I tried this
<head runat="server">
<link id="Link1" runat="server" rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<title>ECM Test Login</title>
<link rel="stylesheet" href="cssFramework/ecmStyle2.css" type="text/css" media="screen, projection" />
<link href="WAC/WACHeader.ascx" type="text/asp" />
</head>
But the header doesn't show.
I thought of linking the WACHeader page to TestLogIn page but how?
Please help me with this. Thanks.