Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to ...

Status
Not open for further replies.

RichS

Programmer
Apr 24, 2000
380
US
I have a aspx page that is used to import information from a csv file to a database. Some of the files are large and this can take several minutes. I would like to show the progress of the action to the user. Currently they keep wanting to reboot because after 15 minutes they think that their machine is locked up.

The problem is that when the user clicks the Import button the page does a post back and runs starts the import and will not render the progress bar until the import is finished.

Is there a way to render the page (the client side stuff) on postback before starting the import (the server side stuff)?

I am open to any kind of ideas here.

Thanks
Rich
 
Would it be possible to do something like this:

Unload all the updating code to a seperate page. Then, when the user wants to update the databases/upload the files/whatever it is it does, they click the button, and are redirected to this new page.

The new page takes care of all the processing, and displays something like "Processing occuring. This may take a few minutes. Please don't close this or you'll screw it up" (heh, well, you get the idea). Then, when the processing is over, you just have in your code behind saying response.redirect to another page. voila! done.

D'Arcy
 
Hey, thanks for the reply. That's exactly what I am trying to do but how do I get the HTML message "Processing occuring. This may take a few minutes. Please don't close this or you'll screw it up" (I think I'll use this.. :) ) to display before the processing starts. The process is run from the code behind and nothing will render before it finishes?
 
hmmm...true.

Well, actually, you could do something like this:

When they click a button to begin the processing, just have this added into the code behind in the page init:
button.attributes.add("onclick", "javascript:alert('Processing may take a few minutes. Do not close the browser session as this will screw it up!')")

This way, when the user clicks the process button, the onclick event will already be in the CLIENT side of things, show hte message box, they hit OK, and the server continues processing.

D
 
Hey, good - I'll try that. I may also look into multithreading.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top