I have a MasterPage (Site1) and a content page (WebForm4), if I define the mastertype directive like this:
<%@ Page Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="WebApplication1.WebForm4" Title="Untitled Page" %>
<%@ MasterType TypeName="Site1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
I build the solution, everything seems OK. When I try to see it I get:
"Parser Error Message: Could not load type 'Site1'
It makes sense :), and its obviously fixed by doing:
<%@ MasterType TypeName="Namespace.Site1" %> (WebApplication1 in this case)
I think the compiler should prompt an error just like when you specify a non-existing/invalid mastertype.
-
Edgardo