473,773 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Wait Page

I have an stored procedure which takes long time to execute. So I am trying
to execute the procedure in another thread by using the thread start
function. After the SP starts processing I want to take the user to a "wait"
page and then return them after the processing is over.

The wait page has http-refresh header which takes it back to the starting
page. Once the starting page has reloaded in page_load procedure I would
like to check whether the processing has finished and if not redirect back to
the wait page.

Problem is I do not know how to pass data back to the application main
thread from the secondary thread. I tried using session using
synchlock.Sessi on, but it errors out.

I also tried to use a callback. But since the callback procedure also
executes in a secondary thread I am getting the same error.

Please help

Nov 19 '05 #1
4 1860
The simplest example I've seen for such a page is this:
http://www.aspnetpro.com/NewsletterA...200308bm_l.asp

--
I hope this helps,
Steve C. Orr, MCSD
http://SteveOrr.net
"PinellasBo y" <Pi*********@di scussions.micro soft.com> wrote in message
news:2F******** *************** ***********@mic rosoft.com...
I have an stored procedure which takes long time to execute. So I am trying
to execute the procedure in another thread by using the thread start
function. After the SP starts processing I want to take the user to a
"wait"
page and then return them after the processing is over.

The wait page has http-refresh header which takes it back to the starting
page. Once the starting page has reloaded in page_load procedure I would
like to check whether the processing has finished and if not redirect back
to
the wait page.

Problem is I do not know how to pass data back to the application main
thread from the secondary thread. I tried using session using
synchlock.Sessi on, but it errors out.

I also tried to use a callback. But since the callback procedure also
executes in a secondary thread I am getting the same error.

Please help

Nov 19 '05 #2
The future will hold new options:
http://www.devx.com/dotnet/Article/26747

You also might consider using a queue and a windows service to handle such
background tasks. This design could improve scalability.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"PinellasBo y" <Pi*********@di scussions.micro soft.com> wrote in message
news:2F******** *************** ***********@mic rosoft.com...
I have an stored procedure which takes long time to execute. So I am trying
to execute the procedure in another thread by using the thread start
function. After the SP starts processing I want to take the user to a
"wait"
page and then return them after the processing is over.

The wait page has http-refresh header which takes it back to the starting
page. Once the starting page has reloaded in page_load procedure I would
like to check whether the processing has finished and if not redirect back
to
the wait page.

Problem is I do not know how to pass data back to the application main
thread from the secondary thread. I tried using session using
synchlock.Sessi on, but it errors out.

I also tried to use a callback. But since the callback procedure also
executes in a secondary thread I am getting the same error.

Please help

Nov 19 '05 #3
Thanks Steve,

I have seen variant of the same approach on couple of places on the web,
one is http://www.eggheadcafe.com/articles/20050108.asp
But this approach requires that you have two asp.net pages one starting page
other the end page where the actual processing will take place. There is
nothing wrong of this method, just I was trying to avoid to split the code on
two different pages...

"Steve C. Orr [MVP, MCSD]" wrote:
The simplest example I've seen for such a page is this:
http://www.aspnetpro.com/NewsletterA...200308bm_l.asp

--
I hope this helps,
Steve C. Orr, MCSD
http://SteveOrr.net
"PinellasBo y" <Pi*********@di scussions.micro soft.com> wrote in message
news:2F******** *************** ***********@mic rosoft.com...
I have an stored procedure which takes long time to execute. So I am trying
to execute the procedure in another thread by using the thread start
function. After the SP starts processing I want to take the user to a
"wait"
page and then return them after the processing is over.

The wait page has http-refresh header which takes it back to the starting
page. Once the starting page has reloaded in page_load procedure I would
like to check whether the processing has finished and if not redirect back
to
the wait page.

Problem is I do not know how to pass data back to the application main
thread from the secondary thread. I tried using session using
synchlock.Sessi on, but it errors out.

I also tried to use a callback. But since the callback procedure also
executes in a secondary thread I am getting the same error.

Please help


Nov 19 '05 #4

"PinellasBo y" <Pi*********@di scussions.micro soft.com> wrote in message
news:2F******** *************** ***********@mic rosoft.com...
I have an stored procedure which takes long time to execute. So I am trying to execute the procedure in another thread by using the thread start
function. After the SP starts processing I want to take the user to a "wait" page and then return them after the processing is over.

The wait page has http-refresh header which takes it back to the starting
page. Once the starting page has reloaded in page_load procedure I would
like to check whether the processing has finished and if not redirect back to the wait page.

Problem is I do not know how to pass data back to the application main
thread from the secondary thread. I tried using session using
synchlock.Sessi on, but it errors out.

I also tried to use a callback. But since the callback procedure also
executes in a secondary thread I am getting the same error.

Please help

Can you just stay on the page and make the wait portion visible (and the
rest not visible) while the server is processing. One way to check for
completed process is to use cache. You can put something in cache while
processing, check for it and continue the wait page if the cache item is
still present. Once the operation is completed, clear the cache can
redisplay. Don't know if this helps or not.

Mike
Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5723
by: Lucas Tam | last post by:
Does anyone have easy to use sample code to build a "Please wait... processing data screen?" I'm interested in something like Expedia's search page Thanks. -- Lucas Tam (REMOVEnntp@rogers.com) Please delete "REMOVE" from the e-mail address when replying.
6
2445
by: SP | last post by:
Hi, I want to add wait cursor code whenever page is post back. Page may be post back on my user control's or on change of dropdown or on click of any button on page. so is there any common solution available that will provide me mechanism to display wait cursor or wait image to user whenever page is post back to server? Thanks,
2
1946
by: s_erez | last post by:
Hi, This is a realy tricky one. I have an ASP.NET application where some pages are reading data from a DB and presenting reports. In order for the user to wait while the page is reading data from the DB I am using a DIV with a please wait message which is removed once the page is loaded. In addition I am using a global error handling using the Application_Error void in the Global.asax file. when the application is loading a page which...
4
3502
by: puja patel | last post by:
hi all, I am developing a shopping cart website in C# where after selecting item, user enters credit card details and click on submit button.This request is then processed by the gateway which usually takes from 5-10 sec of waiting period to get response back if the transaction was approved of declined. I want to implement page which says "Please wait...your request is being processed." after user clicks on submit button and before I...
5
3236
by: Jeremy | last post by:
Hi all, I have database actions that will potentially take several seconds to complete. My normal page uses AJAX so keeping the user informed of what is happening is not a problem. However, the page also has fallback code in case of no Javascript. In this case I would like to display temporary "please wait" type page
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8937
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7463
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.