2
I have an application on Asp.net mvc 5 where the code below works locally (visual studio 2012), but does not work after the publication on the server.
controllerAction = "/Controller/Action/"
controller = "/Controller/"
$('#approve-btn').click(function () {
$.ajax({
type: "POST",
url: controllerAction,
data: { id: idElementoClicado },
datatype: "html",
success: function (data) {
$("#ajaxgrid").load(controller + ' #ajaxgrid', function () {
});
},
error: function () {
alert(response);
}
});
$('#modal-container').modal('hide');
});
[HttpPost]
public ActionResult Excluir(CentroCustoViewModel viewModel)
{
//bloco de execução
return Json(datasource, JsonRequestBehavior.AllowGet);
}
By clicking the trigger button the action always falls in the error event and emits the Alert.
Does anyone know what might be going on?
Thank you
Worked Not Zoom. :(
– Thiago Rodolfo
What should your Localhost LINK look like when you call this function and what domain are you using on the host ? I edited my post with a change.
– Diego Souza
I removed the '/' from the end and continued the same thing (it worked locally and did not work on the server). The link is mounted correctly http://server/nameserver/controller/action/Id
– Thiago Rodolfo
See the Inspect Element error in Chrome.
– Diego Souza
This is the problem, not the error. The action does not happen.
– Thiago Rodolfo