What is the difference between Partial View and Layout?
Layouts allow you to generate a consistent look across your entire site. Think of them like Master pages of ASP.net.
What are Layouts?
You typically want to maintain a consistent look and feel across all of the pages within your web-site/application. ASP.NET 2.0 introduced the concept of “master pages” which helps enable this when using .aspx based pages or templates. Razor also supports this concept with a feature called “layouts” – which allow you to define a common site template, and then inherit its look and feel across all the views/pages on your site. - http://weblogs.asp.net/scottgu/asp-net-mvc-3-layouts
Partial views allow you to construct a view and render it inside of a parent view. For instance, say have a site that allows you to comment on an article. The section in which displays and allows a user to add a comment is a piece of reusable code that is inserted into all of the pages you wish the functionality to exist. What makes this important is that you can then modify that single partial view file to update every view that renders that partial instead of tracking down each page that implements that code individually.
Here is a Youtube Vid that helped me understand partial views rather well. https://www.youtube.com/watch?v=SABg7RyjX-4
edit: Additionally, the guy who created the linked vid has an entire library of playlists that may help a new MVC coders. He walks through a great deal of the MVC features with decent examples. https://www.youtube.com/user/kudvenkat
In addition to Josh's answer, my aweeeesomeee paint skills would like to draw you a picture that should explain all..
Admit it... you're in awe...
You see the header and footer... you could even have partial view's there too.
EDIT...
Layout
To give you a different example of why you use each component (layout / view / partial view), imagine that you own a website that has 100 pages in total, and lets say you want to update the design of your website, how are you going to do it?
Updating each page individually would drive me insane, because your replicating your code constantly for every single page, just to update your design.
This is what the Layout view helps you solve, you use the Layout view to create a template for all of your pages.
View
Using our existing scenario of 100 page website, each page is going to have content that is unique, the View allows us to display this content whilst using our template from the Layout
.
Partial View
Now lets imagine that we allow our visitors to comment on our pages, each comment must look consistent, and behave exactly the same as all the other comments throughout our website... To achieve this, you would use a Partial View
which would act as a template for the comments that you receive on your website.
The benefits of doing this is that you don't have to repeat your code everywhere, you only have to create one Partial View
to render any comment.