I've got this code in my cshtml Details View. I want to send the VM back to this controller method. This works as I can set a breakpoint in the controller however the model is null. Here is the client-side
function downLoadFile() {
$.ajax({
url: '/Software/DownLoadInstall',
type: "POST",
data: JSON.stringify('@Model'),
datatype: "json",
contentType: "application/json; charset=utf-8"
});
}
and here is what my controller looks like
[HttpPost]
public ActionResult DownLoadInstall(SoftwareEditViewModel vm)
{
try
{
SoftwareService.DownLoadInstall(vm);
return RedirectToAction("Index");
}
catch
{
return View();
}
}