1
I have the following ajax call on my page:
$.ajax({
url: 'EquipamentoTemControleFuncionamento',
data: { contratocod: contratocod, numeroserie: numerodeserie },
type: 'POST',
dataType: 'JSON',
success: function(retorno) {
alert('success:' + retorno);
},
error: function() {
alert('error');
}
});
And the following method in my controller that calls another model method that returns a bool:
public JsonResult EquipamentoTemControleFuncionamento(string contratocod, string numeroserie)
{
ControleFuncionamentoModel cfm = new ControleFuncionamentoModel();
return Json(cfm.EquipamentoTemControleFuncionamento(contratocod, numeroserie));
}
I put a breakpoint in the controller’s method, but it’s not stopping. I want to return the Boolean of the Equipment method?
Open the browser console (F12) and see if there is an error in the Ajax call. Also open the link in the browser, and see if the controller is working as expected.
– Randrade
No error on Ajax call
– Raphael Prado de Oliveira