今天被母版页嵌套问题脑袋弄大了,我使用的是vs2005
这是父母版页
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="baba.master.cs" Inherits="MasterPage" %><!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>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</div>
</form>
</body>
</html>只是子 母版页
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="erzi.master.cs" Inherits="MasterPage2" %><!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>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</div>
</form>
</body>
</html>
如何让子母版页继承父模板页里的东西啊?
这是父母版页
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="baba.master.cs" Inherits="MasterPage" %><!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>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</div>
</form>
</body>
</html>只是子 母版页
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="erzi.master.cs" Inherits="MasterPage2" %><!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>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</div>
</form>
</body>
</html>
如何让子母版页继承父模板页里的东西啊?
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Normal.master.cs" Inherits="Wsb.Web.Master.Normal" %><%@ Register Src="../Control/Column.ascx" TagName="Column" TagPrefix="uc1" %>
<%@ Register Src="../Control/Foot.ascx" TagName="Foot" TagPrefix="uc2" %>
<%@ Register Src="../Control/Top.ascx" TagName="Top" TagPrefix="uc3" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<uc3:Top ID="Top1" runat="server" />
<!--中间部分开始-->
<table width="996" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="225" valign="top">
<uc1:Column ID="Column1" runat="server" />
</td>
<td width="13">
</td>
<td align="center" valign="top" style="width: 956px">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</td>
</tr>
<!--这部分是我现在加上去的,原代码没有,只是说明一个意思-->
<tr>
<td colspan="3">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</td>
</tr>
</table>
<!--中间部分结束-->
<uc2:Foot ID="Foot1" runat="server" />
</div>
</form>
</body>
</html>