0
我有我的一些Html.RenderPartial和裏面隨機的ContentPlaceHolder,或多或少像這樣的母版頁:Asp.net-mvc PlaceHolder,如何使用它?
<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:內容在我的看法,我不想鏈接它在母版頁,但在GenericControl。
顯然我不能使用ContentPlaceHolder。我正在嘗試使用PlaceHolder,但我遇到了一些問題以找到如何使用它。
我的專業版用幾句話來說,瑕疵是他們給了我那些文件,他們說:「讓這個網站工作,並使其好看!」 而且我仍然在學習這個_logic_是如何工作的。 無論如何感謝您的答案,我會嘗試你的建議。 – krvl