我有我的母版页,里面有一些 Html.RenderPartial 和一个随机的 ContentPlaceHolder,或多或少像这样:
<body>
<% Html.RenderPartial("Controls/Menu"); %>
<% Html.RenderPartial("Controls/GenericControl"); %>
<asp:ContentPlaceHolder ID="MyContent" runat="server" />
</body>
目前在Menu.ascx文件中,我有一个按钮列表。在GenericControl.ascx文件中有一些按钮来管理内容。
我的菜单中有与按钮一样多的视图,内容是这样描述的:
<asp:Content ID="Content1" ContentPlaceHolderID="MyContent" runat="server">
<div>Some divs here</div>
<asp:Content>
这是我的问题。我想在我的视图中添加另一个asp:Content,我不想在母版页中链接它,而是在 GenericControl 中。
显然我不能使用 ContentPlaceHolder。我正在尝试改用 PlaceHolder,但在查找如何使用它时遇到了一些问题。