I have a controller method set up for file download, and it works (user is prompted to open/save file) if the method is called directly using a hyperlink. However, if I chose to explicitly call the method by doing an explicit get request, I don't get the prompt for the file download, although the action method is successfully called.
$("#id").click(function (e) {
e.preventDefault();
var postdata = { filename: $("#filename").text() };
$.get("/Test/Fix", postdata);
});
Does anyone know a workaround for this? Or is this by design?