0

For an ASP.NET MVC 5 project, is there some kind of priority ranking between views?

And do they need to be in separate folders within the project?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • What exactly do you mean by "priority ranking"? You use one view or another based exclusively on it's file path. They don't need to be in separate folders, but doing so is how MVC works by default, and if you want it to work in any other way you need to configure it as such – Camilo Terevinto Sep 24 '21 at 11:05
  • OK second part of your comment is the answer of the question I was asking myself. Thank you for your help – Big Moustache guy Sep 24 '21 at 11:11
  • By priority ranking I mean views that may be processed first by the browser. – Big Moustache guy Sep 24 '21 at 11:16
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Oct 02 '21 at 12:08

1 Answers1

0

Although I am answering a year later but I should say "Yes there is!" to your first question. The locations are listed at a string list called ViewLocationFormats in the RazorViewEngin. You can even change the list by inheriting the RazorViewEngine, take a look at here or even changing the existing one So the answer to your second question is that they should be anywhere as long as the containing folder listed in the view locations of the used RazorViewEngine.

MD Zand
  • 2,366
  • 3
  • 14
  • 25