2

In this SO post, none of the answers specified explicitly whether there's any difference between @Html.RenderPartial and @RenderPage. Is @RenderPage just a "prettier" version than @Html.RenderPartial, in a sense that you don't have to wrpa it inside of @{} because it doesn't return void?

Edit: Didn't I just explain how is my question different from the one I linked to?

Community
  • 1
  • 1
anemaria20
  • 1,646
  • 2
  • 17
  • 36
  • @EmreBolat the OP mentioned it in post that the link does not actually gives a correct answer...I dont think it is a duplicate..:/ – SamGhatak May 20 '16 at 11:34
  • @EmreBolat I actually linked to that link and explained why my question isn't a duplicate. Please remove the flag. – anemaria20 May 20 '16 at 11:39
  • You are still duplicating an already asked question while you can easily ask your question on the comments section of the original question. –  May 20 '16 at 11:43
  • How is this question "already asked"? The duplicate was about Partial vs. RenderPage, not RenderPartial vs. RenderPage. – anemaria20 May 20 '16 at 11:50
  • @EmreBolat Though it's encouraged to watch out for duplicates and I don't want to discourage you, this one isn't a duplicate. And SO is a _Q&A_ site, not a discussion forum. So it's better to ask a new question instead of adding it to comment sections of older ones. – René Vogt May 20 '16 at 11:53

1 Answers1

1

There is no difference in the functionalities of both but there is a difference in the usage. You don't have to specify path for the view in the RenderPartial but for RenderPage you must have to specify path for the view. RenderPartial can be more helpful in situations where you have to show views at run time on matching of some particular condition. Obviously if all the views are contained in Shared Folder or Controller's name matching folder. RenderPartial will be handy then. You don't have to re-type path all the way.

I am lazy developer so i prefer things which takes me to work less. :)

Sometimes Code
  • 591
  • 3
  • 14
  • 33