ASP.NET MVC Actionlink outside the area

Asked

Viewed 217 times

0

I’m having a hard time making a simple feature. I have an area called "project":

inserir a descrição da imagem aqui

The goal is simple: I need to create an Html.Actionlink that generates a link to return the home page that is OUTSIDE the project area, such as the root of the site. I tried to call it that:

 @Html.Action("ACTION","CONTROLLER")

Code of controller:

// GET: Relatorio
public ActionResult ModalRelMapaAeronave()
{
    return PartialView("ModalRelMapaAeronave");
}

But it’s not being called the right view. What’s the right way to call?

  • Enter the code of the Controller method that calls a particular one View !!! I wonder is arriving on the route?

  • It’s not enough, it goes wrong, it adds up the value of the area on the route I want, when I want to call the direct route from the root.

  • ModalRelMapaAeronave is in which Controller ?

  • The solution of the River worked, looked at the root. Thanks guys

1 answer

2


To indicate that you will not access a Controller from within their area, enter it as an empty parameter in the call:

@Html.Action("ACTION","CONTROLLER", new { area = "" })
  • 1

    This works if I want to access another area?

  • 1

    It worked for what I asked for

  • To access another Area, simply enter it in the parameter: @Html.Action("ACTION","CONTROLLER", new { area = "MINHAAREA" })

  • 1

    It worked too thanks.

Browser other questions tagged

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