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.
精彩评论