What is the difference between a View and a PartialView in ASP.NET MVC?

后端 未结 6 1609
粉色の甜心
粉色の甜心 2020-12-16 09:28

What is the difference between a View and a PartialView in ASP.NET MVC?

At first glance the need for both seems non-obvious to me.

6条回答
  •  不知归路
    2020-12-16 10:04

    It works like that:

    • return View() the view content goes in the @RenderBody() of the /Shared/_Layout.cshtml

    • return PartialView() it returns only the view content

提交回复
热议问题