Chapter 4. Master Pages

In this chapter, we will cover:

  • How to create a master page
  • Determining the master page in the ActionResult
  • Controlling which master page is used with a view base class
  • Setting the master page from a controller base class
  • Passing data to the master page
  • Rendering data in a master page from another view
  • Creating nested master pages

Introduction

Master pages are a very important part of any large-scale site. They allow you to easily manage the boilerplate code that every page in your site uses. This might encompass features such as navigational items, header and footer layout, basic layout, and so on.

In this chapter, we will discuss how to create and use master pages to control application-wide formatting. We will also take a look at how to employ a base page, to control which master page is used. Then we will see how to pass data from the view to the master page.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset