I need to do a POST after a click of a button, so that this POST activates a method in an MVC controller, was testing like this:
[HttpPost]
public void GerarPDF()
{
string teste = "teste";
}
The name of the Controller is ItemController, and in the button I put the ng-click with the function of the angle:
<button type="submit" ng-click="exibiritem()" class="navbar-btn btn btn-modal" style="margin-right:0px;" id="btnExibir">
<center>Exibir</center>
</button>
And in the angle controller:
function exibiritem(){
$http({
url: "/item/GerarPDF",
method: "POST"
)};
}
I just can not get the function in the MVC controller to run. If someone can help me, I'd be grateful because my angular knowledge is still pretty basic.