I'm trying to make my masterpage work with my content page, allowing the content page to access the master page controls. I get the error:
Parser Error Message: The 'mastertype' directive must have exactly one attribute: TypeName or VirtualPath
This is on the lines:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="viewProduct.aspx.cs" Inherits="AlphaPackSite.viewProduct"
MasterPageFile="MasterPages/Main.master"
title="Hi there!"
%>
<%@ MasterType TypeName="Main" VirtualPath="MasterPages/Main.master" %>
My master page is:
namespace AlphaPackSite
{
public partial class Main : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
I'm a bit confused with namespaces and such so may have got them wrong, but all pages are in the same namespace now I beleive.
Update
When I turn it to:
<%@ MasterType VirtualPath="MasterPages/Main.master" %>
I keep getting the error:
Compiler Error Message: CS0030: Cannot convert type 'AlphaPackSite.Main' to 'ASP.masterpages_main_master'
Source Error:
Line 147: public new ASP.masterpages_main_master Master {
Line 148: get {
Line 149: return ((ASP.masterpages_main_master)(base.Master));
Line 150: }
Line 151: }