3
I have a project, which is in an area, in it, my Main controller, has an action that, when called, should return a view that is in another folder, however, within the same area.
return View("OutraPasta/Index.cshtml");
return View("~/Views/OutraPasta/Index.cshtml");
return View("~/Views/Area/OutraPasta/Index.cshtml");
but none of the options actually returns this view.
What is the purpose of this?
– Leonel Sanches da Silva
Redirect to another view, Ué...
– Aline
But why another directory within the same area? Why can’t the View template be in the same directory?
– Leonel Sanches da Silva
Because each module needs to be in its own structure. But the view you require is in the main structure. And the responsible person wants to see in the views the folders of the modules. This is the case? = T
– Aline
Yes, the area has this objective: to offer its own structure, as a module, detached from the main structure. Maybe you are incurring a bad practice.
– Leonel Sanches da Silva