Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
134 views
in Technique[技术] by (71.8m points)

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

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?

question from:https://stackoverflow.com/questions/4092884/what-is-the-correct-place-for-partial-views-in-asp-net-mvc

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...