0

在我的主页中,我有:

<html>
<head runat="server">
    <title>Master Page</title>
</head>
<body>
    <form runat="server">
    <div>
    <table cellpadding="0" cellspacing="0" style="width: 100%">
    <tr>
    <td align="center">
       <img src="images/download.jpg" alt="manipallogo" />
    </td>
    <td align="center" valign="middle">
       <h2 style="font-style:normal;font-size:x-large">Mobility Sanjivini</h2>
    </td>
    <td align="center">
       <img src="images/philips.jpg" alt="philipslogo" 
                            height="84" width="170" />
    </td>
    </tr>
    <tr>
    <td colspan="1">
        <asp:ContentPlaceHolder runat="server" ID="cntplace1">
        </asp:ContentPlaceHolder>
    </td>
    <td colspan="2">
    <asp:ContentPlaceHolder runat="server" ID="ContentPlaceHolder2">
    </asp:ContentPlaceHolder>
    </td>
    </tr>


    </table>
    </div>
    </form>
</body>
</html>

嵌套的多页:

<asp:Content ID="Content1" ContentPlaceHolderID="cntplace1" Runat="Server">
    <table width="100%">
        <tr> 
        <td>
           <asp:Label runat="server" ID="lblImmu" Text="Immunization Details">
           </asp:Label>
        </td>
        </tr>
        <tr>
        <td>
           <asp:Label runat="server" ID="lblDel" Text="Immunization Details">   
           </asp:Label>
        </td>
        </tr>
        <tr>
        <td>
           <asp:Label runat="server" ID="lblMal" Text="Immunization Details">
           </asp:Label>
        </td>
        </tr>
    </table>
</asp:Content>

但是当我运行时,不会显示嵌套页面标签。请有人告诉我哪里出错了。

4

1 回答 1

0

asp:content 与 ContentPlaceholderID 属性对齐。所以你必须在你的母版页中添加它:

<asp:ContentPlaceHolder runat="server" ID="cntplace1" ContentPlaceholderID="cntplace1"></asp:ContentPlaceHolder></td>
于 2012-07-25T13:31:53.137 回答