Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between RenderPartial and Partial method [duplicate]

Tags:

asp.net-mvc

Possible Duplicate:
Html.Partial vs Html.RenderPartial & Html.Action vs Html.RenderAction

I have 3 questions.

1-Whats is exactly difference between RenderPartial and Partial method?

1-Whats is exactly difference between RenderAction and Partial RenderPartial ?

2-What is the RendePage method?

like image 528
Shahrooz Jafari Avatar asked Dec 20 '22 16:12

Shahrooz Jafari


1 Answers

RenderPartial writes the result directly to the response, technically speaking, directly into the calling object's TextWriter. RenderPartial is a bit faster and hence developers prefer using it inside the looping constructs and related scenarios.

Partial on the other hand returns the HTML markup as string, which buffers the content. It achieves by creating and using a separate TextWriter.

RenderAction Invokes the specified child action method and renders the result inline in the parent view. In other words allows you call Action from view.

RenderPage Renders the specified view (identified by path and file name rather than by view name) directly to the response stream, like Html.RenderPartial().

Everything depends on situation.

like image 164
webdeveloper Avatar answered May 03 '23 08:05

webdeveloper