I am trying to figure out why my Ajax query is not being sent to the controller when trying to send HTML data.
Using this simple POST to send the data:
var contentFull = $("#contract").html();
var url2 = '@Url.Action("SavePDF", "FRP")';
$.ajax({
url: url2,
type: 'POST',
contenttype: 'text/plain',
async: true,
data: {
Content: contentFull
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
CustomAlert.render(XMLHttpRequest);
CustomAlert.render(textStatus);
CustomAlert.render(errorThrown);
CustomAlert.render("Error while posting SendResult");
},
success: function (result) {
CustomAlert.render("Yey?");
}
});
When changing contentFull to a simple string ("test"); the function SavePDF will activate and the content will be filled correctly. When using the POST as is; the succes function will fire off, but the SavePDF function is completely ignored.
I've been looking like crazy figuring out what the reason could be. First thought was the character limit issue which should be solved by using POST.