Buenas foreros !!!
A ver si me pueden ayudar con este pequeño problema.
Estoy intentando llamar a un Metodo de mi controlador, desde Ajax.
La cuestión es que la llamada se hace correctamente, pero al recibir la respuesta a mi cliente, en vez de procesar el Success, se procesa el error, y el mensaje que me llega es: "Internal Server Error".
No entiendo por que me sale esto, si la petición al servidor llega correctamente...
El código que tengo es el siguiente:
SERVIDOR
Código:
public JsonResult SaveConfiguration(bool notificationsEnable, int notificationInterval, int notificationType)
{
return Json(true);
//Tambien probe con return new JsonResult{Data = true};
}
CLIENTE
Código:
$.ajax({
type: "GET",
dataType: "json",
url: urlSaveConfiguration,
data: ({ notificationsEnable: notificationsEnable, notificationInterval: notificationInterval, notificationType: notificationType }),
cache: false,
contentType: 'application/json; charset=utf-8',
success: function (data) {
alert('ok');
//alert(data);
},
error: function (xhr, textStatus, error) {
alert('error:' + error);
}
});
Como ya he dicho, la llamada al metodo del serivdor se hace correctamente, por eso omito variables de javascript y demás.
Espero podais ayudarme. Gracias.