Insert ASP.net, and then refresh the page

I am working on a C # project using ASP.net.

I have a list of reports with a hyperlink for everyone that calls the web server, retrieves the PDF, and then returns the PDF to save or open the user:

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 also like to refresh the page with the updated list.

I'm having problems since a single request / response returns a report.

Is there any way to refresh the page?

As long as there is a correct answer, feel free to include answers that detail alternative solutions / ideas for this.

+3
source share
2 answers

, . HTTP - , . - ", , , ". " " - . - . " ", " ". - ? ? ?

, , JavaScript , .

+9

response.redirect(request.url.tostring) context.Response.Flush();

-1

Source: https://habr.com/ru/post/1722538/


All Articles