0

Actions reside in controllers, That makes it easy to say Action X in Controller Y.

Views have a similarity to action, the name of the folder that they are in must match the name of controller, Do we say View X for Controller Folder Y ? or is there another term used for the folder that contains all the view for a Controller?

Erik Philips
  • 51,408
  • 11
  • 123
  • 146
jimjim
  • 2,284
  • 2
  • 23
  • 43
  • 3
    The name of the folder that they are in does **not** need to match the name of controller - that's just a convention and means you no not need to explicitly declare the path to the view. –  Oct 17 '16 at 00:43
  • @StephenMuecke : Huh? how do we return a view from a different folder? Beside convention I thought it is a restriction of how mvc works, can't return a view from a different folder other than the one matching the controller name. – jimjim Oct 17 '16 at 01:01
  • 2
    Of course you can. You can specify the full path to the view, or you can configure the view engine to search for view files in any folder you want (refer [this answer](http://stackoverflow.com/questions/632964/can-i-specify-a-custom-location-to-search-for-views-in-asp-net-mvc) for an example). –  Oct 17 '16 at 01:03
  • I'd also mention that the Default ViewEngine looks for a view in multiple folders already, so which folder? – Erik Philips Oct 17 '16 at 01:21

1 Answers1

1

Is that important how you call the folder?

There is no special name for that folder. And really, folder with views for the controller is a vague term - some views can have partial views that sit in Shared folder. And you can also implement your own ViewEngine with your own convention. Or even supply view files from a database.

So to answer your question - there is no special term.

trailmax
  • 32,740
  • 21
  • 133
  • 228