473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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.Session, 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 1834
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
"PinellasBoy" <Pi*********@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.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.Session, 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
"PinellasBoy" <Pi*********@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.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.Session, 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
"PinellasBoy" <Pi*********@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.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.Session, 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

"PinellasBoy" <Pi*********@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.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.Session, 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
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...
6
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...
2
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...
4
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...
5
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. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...

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.