c# - Async operations in ASP.NET WebForms -


asp.net webforms targetting .net 4. need show pdf document on page (in iframe), loading pdf takes lot of time, idea load pdf document async , show waiting message in iframe, once pdf ready, show pdf in iframe.

// printpdfview.aspx <div id="pdfdiv" style="height: 100%;">     // show pdf if ready otherwise waiting message     <iframe runat="server" width="100%" height="100%" id="pdfviewdoc" /> </div>  // printpdfview.aspx.cs protected override void onprerender(eventargs e) {                 //...                 // long running process                 calldocumentsservice();                 //...                 pdfviewdoc.attributes["src"] = "showpdfview.aspx"; }  // showpdfview.aspx // when pdf ready, rendered on page <body>     <div id="loadingpdf">         <h1>loading document!</h1>             <p>this may take few minutes...</p>     </div> </body>  // showpdfview.aspx.cs protected void page_load(object sender, eventargs e) {     // ...     response.binarywrite(pdftodisplay);     //... } 


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -