开发者

asp.net mvc html helper problem on nested Master Page

Site.Master



<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>

 

<body>

            <asp:ContentPlaceHolder ID="Menu" runat="server">

                开发者_JS百科<!-- Menu goes here -->

            </asp:ContentPlaceHolder> 

</body>

Sub.Master



<%@ Master Language="C#" MasterPageFile="~/Views/Shared/Site.Master" %>

<asp:Content ID="Content4" ContentPlaceHolderID="Menu" runat= "server">

    <% Html.RenderPartial("MainMenu"); %>       

</asp:Content>

This is the error when the application runs:

The name 'Html' does not exist in the current context


Add Inherits="System.Web.Mvc.ViewMasterPage" in the sub.Master directive.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜