![](/images/new-backgrounds/1175219/175219561x1.webp)
258Microsoft Visual Studio 2010: A Beginner’s Guide
Organizing View Files
The file structure in Figure
a Controller passes control to a View, by calling View, ASP.NET MVC searches for the View in the Views folder with the subfolder named the same as the Controller and the file named the same as the action calling the View.
Notice that there is a Shared folder. Sometimes, you’ll want to have a View that is shared by two or more Controller actions, and you can put these shared Views in the Shared subfolder. Whenever ASP.NET MVC doesn’t find a View in the
Assigning MasterPage Files
Most sites on the Web have multiple pages, each with common elements. They all have the same header, menu, sidebars, and footers. When you first build a site, you can duplicate this common content with no trouble, but this
This is where MasterPages help, allowing you to specify the common content in one place where you can have content pages that use the MasterPage. Whenever something changes in the common content, you update the MasterPage, and every page of a site that uses the MasterPage is automatically updated. Listing
Listing 9-3 A MasterPage
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
<!DOCTYPE html PUBLIC
<head runat="server">