Specify custom View paths in ASP NET Core 2.0 MVC 5?

Asked

Viewed 143 times

-1

I’m having a big problem specifying the path I want the controller to search for the view relating to it.

I’m using more than one subfolder within an area:

inserir a descrição da imagem aqui

I want the controller to be able to navigate to folders like "Browsing" and "Services" (Views/Services/(view name).

What would be the best way to do it?

1 answer

1


Each folder in your View is usually related to one of your controller, so if you want to trigger another view from another controller, that is, from the same folder, you only need to use the following:

return RedirectToAction("Action", "Controller")

If you want to trigger a view of the same controller, that is, of the same folder, you can do so:

return RedirectToAction("Action")

or

return View("Action")

It all depends on what you want/need to do...

To keep it simple for you, think of a Action is a View

  • 1

    It worked thanks :D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.