<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ModelCentral.AbModel>" %>
ASP.net what means is MasterPageFile attribute?
答案 0 :(得分:0)
Each .aspx page can reference a master page. The master page can define the general layout for that specific page (obviously you can use a masterpage for multiple pages).
Imagine you have a standard website with a main menu, a content area and a footer. The master page would include the main menu and the footer since they usually don't change.
Moreover the master page contains a <asp:ContentPlaceholder>
which will later be populated by the content of your .aspx-page.
A master page can contain multiple <asp:ContentPlaceholder>
. In your .aspx-page you can use the <asp:Content>
control to populate a <asp:ContentPlaceholder>
with your content. Note that you have to match the ContentPlaceHolderID
of your <asp:Content>
with the correct ID of your `.
Read this article for more information on the subject.