Hi!
I've created a custom Action Result in my MVC application, where I generate a CSV file according to the configuration that the user provides.
However. The problem I have now is that if I create a download link like this:
<a ID="lnkDownload" href="<%= Url.Action("DownloadFile", "Download", new { id = Model.Id, userId = Model.userId, startDate = "30/05/2010", endDate = "30/05/2005"}) %>">Download</a>
it all works fine. The thing is that I've now introduced two date time controllers on the page, so that the user can set the start and end date. Therefore I'm now adding in the dates from the controller to the url like this:
$('#lnkDownload').click(function() {
var startDate = $('#tbExtrateStartDate').val();
var endDate = $('#tbExtrateEndDate').val();
var link = $('#lnkDownload').attr('href') + "&startDate=" + startDate + "&endDate=" + endDate;
$.get(link, function() {
});
return false;
});
This gives me the problem that the "download prompt" does not appear at all. I've tried to figure out why, but haven't really found any solution.
How can I solve this?