--excerpt from the ASP. NET MVC 4 Advanced Programming
The partial helper method is used to render a partial view into a string. The Partial method uses 4 overloaded versions, as follows:
Public void Partial (string partialviewname); Public void Partial (stringobject model); Public void Partial (string partialviewname, viewdatadictionary viewData); Public void Partial (stringobject model, Viewdatadictionary viewData);
For example, the following code renders a partial view named Albumdisplay.
@Html. Partial ("albumdisplay")
The RenderPartial helper method is very similar to the Partial, but the renderpartial is not a return string but is written directly to the response output stream. For this reason, renderpartial must be placed in a code block, not in a code expression. For example, the following two lines of code write the same content to the output stream:
@Html. Partial ("albumdisplay") @{html.renderpartial (" Albumdisplay");}
Which method should I use here? In general, because the partial is simpler, you should choose partial. However, RenderPartial has better performance because it is written directly to the response stream, but this advantage requires a lot of use (high site traffic or repeated calls in the loop) to see.