Html. Partial and Html. RenderPartial in MVC, html. renderpartial
The Partial auxiliary method is used to render some views into strings. Note:You do not need to specify the path and file extension for the view, because the logic for locating some views at run time is the same as that for locating normal views.. For example, the following code renders a partial view named AlbumDisplay. You can use all available view engines to search for them at runtime:
@ Html. Partial ("AlbumDisplay ")
The RenderPartial auxiliary method is very similar to Partial, but RenderPartial does not return a string, but directly writes the response output stream. For this reason, you must put RenderPartial in the code block rather than in the Code expression. To illustrate this, the following two lines of code write the same content to the output stream:
@ {Html. RenderPartial ("AlbumDisplay ");}
@ Html. Partial ("AlbumDisplay ")
Which method should be used? GenerallyPartial is more convenient than RenderPartialSelect Partial. However,RenderPartial has good performanceBecause it is directly written into the response stream, but this performance advantage requires a lot of use (high website traffic or repeated calls in the loop) to see.
-- From ASP. NET MVC4 advanced programming (version 4)