管理 ContentPlaceHolder 的母版页
我有一个 C# 母版页,其中有以下代码:
<div style="width: 30%;height: 500px;float:left">
<asp:ContentPlaceHolder ID="cphMenu" runat="server">
</asp:ContentPlaceHolder>
</div>
<div style="width: 65%;height: 500px; float:right">
<asp:ContentPlaceHolder ID="cphMain" runat="server">
</asp:ContentPlaceHolder>
</div>
如您所见,我有两个 ContentPlaceHolders,第一个是左侧菜单 (cphMenu),第二个是页面本身。因此,我想单击菜单中的一个项目(菜单是树视图)并将该特定页面加载到第二个 contentplaceholder (cphMain) 上。
我怎样才能得到这种行为?
提前致谢。
I have a master page in C#, where I have this code:
<div style="width: 30%;height: 500px;float:left">
<asp:ContentPlaceHolder ID="cphMenu" runat="server">
</asp:ContentPlaceHolder>
</div>
<div style="width: 65%;height: 500px; float:right">
<asp:ContentPlaceHolder ID="cphMain" runat="server">
</asp:ContentPlaceHolder>
</div>
As you can see, I have two ContentPlaceHolders, the first one is the left menu (cphMenu), and the second one is the page itself. So, I want to click an item from the menu (the menu is a treeview) and load that specific page on the second contentplaceholder (cphMain).
How can I get that behaviour??
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为每个“特定页面”创建内容页面,让它们使用您的母版页,将正确的内容放入 cphMain 中,
然后在 treeView 中添加这些页面的 URL。
母版页就像内容页的模板,因此它将内容页中的内容填充到占位符中。
create content pages for each 'specific page', make them use your master page, place correct content into the cphMain
then in treeView add URLs for these pages.
Master page is like a template for content pages, so it will fill the content from content page into placeholders.