Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Action() and RenderAction()?

Tags:

asp.net-mvc

In asp.net mvc2, what's the difference between

Html.Action(...)

and

Html.RenderAction(...)

?

like image 998
Arnis Lapsa Avatar asked Jan 18 '10 10:01

Arnis Lapsa


1 Answers

Phil Haack does a great job explaining the two methods in this post.

"The difference between the two is that Html.RenderAction will render the result directly to the Response (which is more efficient if the action returns a large amount of HTML) whereas Html.Action returns a string with the result."

like image 186
Ryan Rivest Avatar answered Oct 20 '22 18:10

Ryan Rivest