我嘗試過實現this,但是當我在VB中重寫它們時擴展方法不工作。我正嘗試在我的MVC3應用程序中使用公司母版頁。現在我有我的.Master
和我的.ascx
頁面。我對如何在剃刀視圖中展現它感到困惑。在剃刀視圖中使用webform母版頁
我.ascx
頁:
<%@ control Language="VB" Inherits="System.Web.Mvc.ViewUserControl" %>
<asp:Content ID="Content" ContentPlaceHolderID="ContentArea" runat="server">
<div>
Hello World
</div>
</asp:Content>
當我運行它,它給了我這個錯誤:Content controls have to be top-level controls in a content page or a nested master page that references a master page.
我用我的_ViewStart.vbhtml
到.ascx
呼叫網頁上。
真有那麼你很難不只是重寫你的母版頁爲MVC頁面佈局? –