Code for checking page load

How to check if the page has finished loading? When possible, how can I execute a method already created in C # code for this page?

I would like to organize the following sequence of events

  • Done Loading Page
  • Download gridview as excel file on page
  • Call this method download()
  • Close browser

How can i do this?

+6
source share
3 answers

Does this answer your question?

Usage example (in C # code)

 protected void Page_Load(object sender, EventArgs e) { Page.LoadComplete +=new EventHandler(Page_LoadComplete); } void Page_LoadComplete(object sender, EventArgs e) { // call your download function } 
+19
source

Use jQuery and make a callback to open the xls file.

There are several solutions described here POST to server, receive PDF, deliver to user w / jQuery

You can basically connect to

 $(document).ready(function() { // do window.location or another one of the options to download the file. }); 
+1
source

You can do this in javascript DOM:

 window.onload = function() { download() } 
0
source

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


All Articles