4
I have an Aspnet MVC project structured as follows:
Projeto L Areas L Area1 L Controllers L MeuControllerArea1Controller.cs Views Area2 L Controllers L MeuControllerArea2Controller.cs Views L MinhaView.cshtml
In Meucontrollerarea1, I have a public method (Minhaactionarea1) that returns a json
, I want to access it from Minhaview who is in Area2.
The code below has not worked, because when running, it searches Minhaactionarea1 in Meucontrollerarea2.
function ObterResultado() {
$.post('@Url.Action("MinhaActionArea1", "../Area1/MeuControllerArea1")')
.done(function (data) {
// Código de sucesso...
})
.fail(function () {
// Código de falha...
});
}
Note: I am using Arearearegistration.
$.post('.. /Area1/Meucontrollerarea1/Minhaactionarea1')
– Joao Paulo
It worked perfectly, post as reply @Joaopaulo the fault was mine here.
– Jedaias Rodrigues