concept partial in category asp.net

This is an excerpt from Manning's book ASP.NET MVC 2 in Action.
For the most part, templates are equivalent to developing a partial for a type. The template markup for our ChangePasswordModel is shown in listing 3.16.
When it comes to rendering common snippets of content, we have many choices for consolidating those snippets into common rendering logic. With the addition of templates in ASP.NET MVC 2, many of the situations when we might use partials are now supplanted by templates. But we still might run into situations where we’d rather not work with the templating infrastructure and instead would prefer to specify exactly which partial to render from the view.
Templates work well with a strongly typed view, but they still need to work with a specific model to execute. Partials, on the other hand, don’t require a model to render. With templates, you’ll usually render a template for a specific member, whereas partials have much looser restrictions.
Partials are analogous to user controls in Web Forms. They’re intended to render snippets of content, when it’s most advantageous to develop these snippets in a view page rather than in code. Because partials can’t contain behavior, they also work best when few or no decisions need to be made inside the partial regarding how to render the content. If you find yourself copying and pasting one snippet of HTML from one view to the next, that snippet is a great candidate for a partial.
The mechanism for rendering a partial is quite simple. We can use the RenderPartial method or the Partial method in a parent view, as shown in listing 10.2.
Listing 10.2. Rendering a partial from a parent view
<h2>Profiles</h2> <table> <tr> <th>Username</th> <th>First name</th> <th>Last name</th> <th>Email</th> </tr> <% foreach (var profile in Model) { %> <% Html.RenderPartial("Profile", profile); %> <% } %> </table>In listing 10.2, we render a list of profiles in a table. For each row, we want to define a partial to render a single row. Even if content isn’t shared with other views, partials can be used to simplify and reduce the amount of markup seen in one view. In our example, it’s similar to extracting a method in a class file. Although that method may only be called once, it can make the view easier to understand.

This is an excerpt from Manning's book ASP.NET MVC in Action with MvcContrib, NHibernate, and More.
Listing 4.3. IViewEngine defines the contract used to locate views and partials.
public interface IViewEngine { ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName, bool useCache); ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache); void ReleaseView(ControllerContext controllerContext, IView view); }
Notice the values that are added in the controller in listing 4.6. We have three key/value pairs and an object set to the Model property (by virtue of passing in “3” to the View method). It is important to know that when a view renders a partial, the partial will get the same ViewData objects; anything passed from the controller will also make it to any partial and any master page (not shown here). This is because ViewData is a member of ControllerBase, and ControllerBase is part of System.Web.Mvc.ControllerContext. System.Web.Mvc.ViewContext derives from ControllerContext, so it has everything ControllerContext has and more.
We also see in listing 4.7 that while rendering a partial, a view can decide to override the ViewData passed into the partial. Even though each view will have access to the same objects in the ViewData dictionary, the instance of ViewDataDictionary is different for each one. Multiple views do not share instances of ViewDataDictionary. We cannot expect to use ViewData as a mechanism for a partial to pass an object back to the parent view. In fact, views should be isolated and should not try to communicate with one another.
Another direction you might take is to allow the partial to be in control of loading its own data. This is helpful for scenarios when you want to package up a reusable view segment that can be used on many views. It is accomplished through a helper method called RenderAction in combination with partial views. These are sometimes referred to as components.