I have a strongly typed View with a small form and a javascript function with ajax usage:
function emitir () {
$.ajax({
type: "POST",
traditional: true,
url: '@Url.Action("EmissaoRapida", "CND")',
data: { model: @Model },
success: function (data) {
alert(data.mensagem);
},
error: function () {
alert("Erro na tentativa de emissão!");
}
});
}
I simply want to send my data model to my controller, the method that will receive the model has the following signature: public JsonResult EmissionRapid (EmissionCND model)
But there is some error, using the Firefox debugger I noticed that something is wrong at the moment of passing the model, because the problem is that the project is not read as I do typing in the view. @model Pro_Certidoo.Areas.Usuarios.Models.EmissaoCND
In the Pro_Certain error it gets a different color, I believe the problem is there and the message I have is this: JavaScript runtime error: 'Pro_Certain' is not defined
Is there any way to fix this or do something similar by sending the complete data model?