I'm starting learning MVC4. I came across the two possibilities of creating a View based on a Razor template or a Master Page.
I would like to understand the practical differences between the two.
For now, I can see that if I create a View using a Master Page, I can override several sections. For example, if my Master defines a "left column" placeholder and a "body" placeholder I can not only define the body for a specific View, but I can also render contents in the "left column" section for example to display controls that are bound to the context in which the page is (from a search box to a stock quote viewer). Also, Master Pages cannot be defined by making use of Razor templates, which are much less verbose than other syntax (partially wrong: someone managed to hack this aspect).
With Razor Layouts, I can only define one contiguous block of the page that can be overridden by specific View, and I should use multiple layouts (breaking DRY) for little changes in other parts of the page. Is my previous statement correct or am I missing something?
Obviously I can render contents in any part of the page by making good use of jQuery, but that's another matter
sections
. You should read this article about how layouts and sections work in Razor. – Tuff