What is the correct place for Partial Views in ASP.NET MVC?

后端 未结 2 1786
温柔的废话
温柔的废话 2021-02-05 00:16

Would someone confirm the best place for a partial view in ASP.NET MVC?

My thinkings are if it\'s a global view that\'s going to be used in many places then SHARED.

2条回答
  •  日久生厌
    2021-02-05 00:55

    I believe you are correct. Here is an example of something I do, general navigation partial views in my Shared directory. and then a partial views for a specific Controller in the Views/[ControllerName] Directory.

提交回复
热议问题