0

When i give the Route default as HomeController and index action. How the MVC is finding the corresponding Master.. Inthis Case Master Page will have lot of other things to load like menu's, Header,footer's wat not... How it will be able to load it.. Is the composite pattern work here..

2)Actually when i hit same URL again it's not loading the entire page again. How it's possible... Is it some kind of Get pattern and removing the HTML DOM and replacing it... I am confused.. Can someone explain the patterns involved here with the reference

satish
  • 2,425
  • 3
  • 23
  • 40

1 Answers1

1

Each View (.aspx.cs) has a top line that tells what master page to refer to when looking at that page.

<%@ Page Language="C#" MasterPageFile="Layout.Master" Inherits="System.Web.Mvc.ViewPage" %>

The master page is then loaded, and the child page is loaded as well.

For #2, it all depends on what caching mechanism you have in place. There are a few caching mechanisms that are interdependent on each other.

  1. Your browser. If it gets a Not Modified HTTP result and the page hasn't expired in your local cache, it will just load the local version.
  2. IIS.
  3. OutputCache (or some other code-level caching), can cache the result of a Controller Action so that it doesn't re-render it each time.
Community
  • 1
  • 1
George Stocker
  • 57,289
  • 29
  • 176
  • 237