Getting a masterpage error in asp.net
<p>I am trying to add a masterpage in asp.net but i am getting an error that saying the page contains markup that is not valid when attached to a masterpage. Here is my masterpage file:</p>

<pre><code>&lt;%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" 
Inherits="Pages_AdminMaster" %&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head runat="server"&gt;
&lt;title&gt;&lt;/title&gt;
&lt;asp:ContentPlaceHolder id="head" runat="server"&gt;
&lt;/asp:ContentPlaceHolder&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form id="form1" runat="server"&gt;
&lt;div style="text-align: right"&gt;
    &lt;asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"&gt;

        &lt;asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click"&gt;Log  Out&lt;/asp:LinkButton&gt;

    &lt;/asp:ContentPlaceHolder&gt;
&lt;/div&gt;
&lt;/form&gt;
</code></pre>

<p>
</p>

<p>And here is the web form that i apply that masterpage:</p>

<pre><code>&lt;%@ Page Language="C#" MasterPageFile="~/Pages/MasterPage.master" 
AutoEventWireup="true" CodeFile="Admin.aspx.cs" Inherits="Pages_Admin" %&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head runat="server"&gt;
&lt;title&gt;&lt;/title&gt;
&lt;style type="text/css"&gt;
    .style1
    {
        text-decoration: underline;
        color: #0000FF;
    }
    .style2
    {
        font-family: 15;
        font-size: 12pt;
        color: #0000FF;
    }
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form id="form1" runat="server"&gt;
&lt;div class="style2" style="text-align: right"&gt;

&lt;/div&gt;
&lt;/form&gt;
&lt;p class="style1"&gt;
    &lt;a href="CreateCourse.aspx"&gt;Create a new course&lt;/a&gt;&lt;/p&gt;
&lt;p class="style1"&gt;
    &lt;a href="ModifyCourse.aspx"&gt;Modify a course&lt;/a&gt;&lt;/p&gt;
&lt;p class="style1"&gt;
    &lt;a href="CreateAccount.aspx"&gt;Create a new account&lt;/a&gt;&lt;/p&gt;
&lt;p class="style1"&gt;
    &lt;a href="DeleteAccount.aspx"&gt;Delete an account&lt;/a&gt;&lt;/p&gt;
&lt;p class="style1"&gt;
    &lt;a href="DisableAccount.aspx"&gt;Disable an Account&lt;/a&gt;&lt;/p&gt;
&lt;p class="style1"&gt;
    &lt;a href="DropStudent.aspx"&gt;Drop a Student from a course&lt;/a&gt;&lt;/p&gt;
&lt;p class="style1"&gt;
    &lt;a href="EnrollStudent.aspx"&gt;Enroll a student to a course&lt;/a&gt;&lt;/p&gt;
&lt;p class="style1"&gt;
    &lt;a href="GetStudentInfo.aspx"&gt;Get Student info&lt;/a&gt;&lt;/p&gt;
&lt;p class="style1"&gt;
    &lt;a href="GetInstructorInfo.aspx"&gt;Get Instructor info&lt;/a&gt;&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>And here is the error in the browser:</p>

<pre><code>Server Error in '/Bannerweb' Application.

Content controls have to be top-level controls in a content page or a nested master 
page that references a master page.

Description: An unhandled exception occurred during the execution of the current web 
request. Please review the stack trace for more information about the error and where   
it 
originated in the code. 

Exception Details: System.Web.HttpException: Content controls have to be top-level 
controls in a content page or a nested master page that references a master page.

Source Error: 

An unhandled exception was generated during the execution of the current web request. 
Information regarding the origin and location of the exception can be identified using   
the 
exception stack trace below.

Stack Trace: 


[HttpException (0x80004005): Content controls have to be top-level controls in a 
content page or a nested master page that references a master page.]
   System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, 
VirtualPath masterPageFile, IDictionary contentTemplateCollection) +8968123
   System.Web.UI.Page.get_Master() +54
   System.Web.UI.Page.ApplyMasterPage() +15
   System.Web.UI.Page.PerformPreInit() +45
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean    
includeStagesAfterAsyncPoint) +328
</code></pre>

<p>Both pages are in a folder named Pages. Can anyone help me with this? Thanks.</p>
