X
xlar54
I have a very simple 2.0 website (framework), that uses a master
page...not. I added the default.aspx page as a webcontent form, with
the master page as it's master page, but the master page is never
displayed. Not sure whats wrong. Below is my code. Any help would
be appreciated. VS2008.
MasterPage1.Master:
<%@ Master Language="C#" AutoEventWireup="true"
CodeBehind="MasterPage1.master.cs"
Inherits="Register.WebApplication.MasterPage1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1"
runat="server">
<p>
This is the master page</p>
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
And default.aspx
<%@ Page Language="C#" MasterPageFile="~/MasterPage1.Master"
AutoEventWireup="true" CodeBehind="Default.aspx.cs"
Inherits="Register.WebApplication.Default" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
runat="server">
<p>
This is default.aspx</p>
</asp:Content>
page...not. I added the default.aspx page as a webcontent form, with
the master page as it's master page, but the master page is never
displayed. Not sure whats wrong. Below is my code. Any help would
be appreciated. VS2008.
MasterPage1.Master:
<%@ Master Language="C#" AutoEventWireup="true"
CodeBehind="MasterPage1.master.cs"
Inherits="Register.WebApplication.MasterPage1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1"
runat="server">
<p>
This is the master page</p>
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
And default.aspx
<%@ Page Language="C#" MasterPageFile="~/MasterPage1.Master"
AutoEventWireup="true" CodeBehind="Default.aspx.cs"
Inherits="Register.WebApplication.Default" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
runat="server">
<p>
This is default.aspx</p>
</asp:Content>