Please wait for a dialog and upload files to asp.net

In my ASP.Net application, I have a requirement that when a user clicks on a user interface element, we create a PDF file for them that they can download. This is currently accomplished by creating a form post on the ashx page. This page basically checks the form and then runs the correct page on the server side, which either leads to the HTML or PDF document of these HTML pages.

On the client, which I know in advance, if we are going to receive PDF or HTML, when its HTML I open a new window and send a form message to this window, and everything works fine. When its PDF does not change the purpose for the form, it remains on the current page.

This works, the user is presented with a save dialog, and the current page is not changed or lost.

The problem is that PDF generation takes 1 to 15 seconds. What I want to do is a popup, please wait. Displaying the popup will be easy, I'm not sure how to find out how to close the popup? The popup will be the div on the current page.

+3
source share
4 answers

The popup may have a client-side timer that checks the server to complete the task. The long-term task of the server is to update the progress in the database table or server cache server, which can be accessed using the polling service.

MSDN. , asp.net Ajax.

ASP.NET 2.0

ASP.NET ""

+3

javascript GIF 1-15 ( ) .

0

. wcf, ajax, . ashx false, , true, .

, , , false; , , false , im done.

, . , , . . , , .

0

:

PDF , .

, , ​​ PDF . gif , Javascript, div, . , . , ​​ .

-1

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


All Articles