ASP.net attachment then refresh page
- by Russell
I am working on a c# project using ASP .net.
I have a list of reports with a hyperlink for each, which calls the web server, retrieves
a PDF and then returns the PDF for the user to save or open:
ASPX page:
<table>
<tr>
<td>
<a href="#" onclick="SubmitFormToOpenReport();">Open Report 1</a>
<td>
</tr>
...
</table>
ASP.Net:
context.Response.Clear();
context.Response.AddHeader("content-disposition", "attachment;filename=report.pdf");
context.Response.Charset = "";
context.Response.ContentType = "application/pdf";
context.Response.BinaryWrite(myReport);
context.Response.Flush();
This works as expected, however I would like it to also refresh the page with an updated list.
I am having trouble as the single request/response is returning the report.
Is there a way to refresh the page as well?
While there is a correct response, feel free to include answers which details alternative solutions/ideas for doing this.