مشكلة مساعد ASP.NET MVC HTML على صفحة Master المتداخلة

StackOverflow https://stackoverflow.com/questions/2332029

  •  22-09-2019
  •  | 
  •  

سؤال

site.master



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

 

<body>

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

                <!-- 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

هل كانت مفيدة؟

المحلول

يضيف Inherits="System.Web.Mvc.ViewMasterPage" في التوجيه الفرعي.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top