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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display msg in long running page

Status
Not open for further replies.

smsinger3

Programmer
Oct 5, 2000
192
US
Hello all.

I have a page that sometimes displays about 2000 lines in an html table on the screen. Between, database calls, calculations and creating the html table it can take up to 1 minute to process the information in the Page_Load() event. I need either a popup window or a message on the screen that says "Please wait while the page is being created...yada yada yada". Does anyone know the best way to do this? I added javascript at the very beginning of the web page to pop up another page, but it only executes AFTER the Page_Load() event occurs, so it doesn't really do any good. Any suggestions?

Thanks! :)

SteveS
 
Thanks, those are great suggestions! However, that brings me to a problem, I think. The .aspx doesn't start rendering until the page_load() is finished, so the progress bar, message, or new window won't execute until the entire processing is finished. Make sense? Here's the order of execution (please correct me if I get this wrong!)

1) Page is submitted
2) Page_load() executes
3) The server side script code is executed on the .aspx page (between the <% %> tags)
4) The html is rendered to the browser
5) Any javascript executes, if any exists. (or is it executed as the page is rendering?)

I would like to render something to the browser as soon as the Page_Load() starts or before.

Any ideas?

Thanks!!


 
To be honest I have just started working with ASP.NET this week, but have worked with ASP for over a year.

Is there any way to stick that code somewhere else?

In &quot;regular&quot; ASP I did a conversion program one time that wrote each line of the database as it processed it, so the whole screen was constantly scrolling with information.

Kris
[lookaround]
 
hmm interesting problem there smsinger. You are right on the order of execution. It got me thinking, without testing I am not sure but, couldn't you open a new page in the page_load() that would display your info? Once your page has loaded then you could close the window.

Ooo another idea just came up as I was typing. Put a hidden check box on the page. In you page_load function do something like this.

If chkbox1.checked then
'process page
else
chkbox1.checked = true
'display a label with a message
'add some script that refreshes the page
end if


Have the check box default to unchecked. That way the page is loaded with your wait message. The checkbox is checked and the script refreshes the page.
On this second trip the page does it's normal processing and displays when it's done.

Yeah yeah for brain, brain work good today
That'l do donkey, that'l do
[bravo] Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top