What's the difference between the ASP.NET Master Page, and the MVC Master Page? And the AJAX Master Page for that matter?
Creating a View Master PageYou add a new view master page to an MVC project by right-clicking the Views\Shared folder, selecting the menu option Add, New Item, and selecting the MVC View Master Page template (see Figure 1).
Now open your Home, About, contact pages and check top line - MasterPageFile="~/Site. Master" that means you have included the master page in your current page. Run your application and check all pages, like Home, About, and Contact it will display Top Menu and Footer links along with the page content in the container.
Mostly it comes down to the default controls and inheritance.
The AJAX Master and ASP.NET Master both inherit from System.Web.UI.MasterPage, while the MVC Master inherits from ViewMasterPage.
Obviously, these give you slightly different controls on this - as stated by John Clayton, the ViewMasterPage exposes the Ajax/Html/Url helpers and the like, which are not available to the other MasterPages.
Other than that, the default controls are slightly different:
The "lifecycle differences" come from the Page/ViewPage, rather than the MasterPage/ViewMasterPage controls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With