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

Martin picture Martin · Nov 4, 2010 · Viewed 14k times · Source

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.

If it's part of a view that's been wrapped up into a partial view to make code reading easier, then it should go into the Views/Controller directory

Am I correct or am I missing something?

Answer

John Hartsock picture John Hartsock · Nov 4, 2010

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.