Html.Partial("MyView")
Displays the "MyView" MvcHtmlString on an MvcHtmlString . It follows the standard rules for viewing the view (for example, check the current directory, then check the Shared directory).
Html.RenderPartial("MyView")
Same as Html.Partial() , except that it writes its output directly to the response stream. This is more efficient because the contents of the view are not buffered in memory. However, since the method does not return any output, @Html.RenderPartial("MyView") will not work. Instead, you should transfer the call to a block of code: @{Html.RenderPartial("MyView");} .
RenderPage("MyView.cshtml")
Maps the specified view (identified by the path and file name, not the name of the view) directly to the response stream, for example, Html.RenderPartial() . You can provide any model you like for presentation by including it as a second parameter
RenderPage("MyView.cshtml", MyModel)
Annabelle Jun 15 '11 at 17:25 2011-06-15 17:25
source share