473,473 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

long process

Hi

I have an asp with a single button. This invokes a method in one of my
classes which performs a terribly long process - can take 15 or 20 minutes.
What is the best way to handle this sort of situation? If I just call my
long method then the browser eventually times out. Can I start a thread
instead, and return immediately to the browser (or does the thread die
almost immediately when the button handling ends and the response is sent to
the browser)?
Thanks,
Peter
May 10 '06 #1
4 1584
Hi Peter,
Yes .net provides you provision for this. You can do it by using
Asynchronous call. .Net provides you AsyncDelegate to call method which you
want to call asynchronously. .Net works on the asynchronous pattern which is
flexible and you dont require to write additional Code in called method. When
the method will complete it will return result through of IAsyncResult. I
cant explain whole working of asynchronous here, but if you need details , I
can provide you links.

"Peter Kirk" wrote:
Hi

I have an asp with a single button. This invokes a method in one of my
classes which performs a terribly long process - can take 15 or 20 minutes.
What is the best way to handle this sort of situation? If I just call my
long method then the browser eventually times out. Can I start a thread
instead, and return immediately to the browser (or does the thread die
almost immediately when the button handling ends and the response is sent to
the browser)?
Thanks,
Peter

May 10 '06 #2
Hi,
"Altaf Al-Amin Najwani" <Al****************@discussions.microsoft.com> wrote
in message news:5E**********************************@microsof t.com...
Hi Peter,
Yes .net provides you provision for this. You can do it by using
Asynchronous call. .Net provides you AsyncDelegate to call method which
you
want to call asynchronously. .Net works on the asynchronous pattern which
is
flexible and you dont require to write additional Code in called method.
When
the method will complete it will return result through of IAsyncResult. I
cant explain whole working of asynchronous here, but if you need details ,
I
can provide you links.

But as this is a asp.net app the page will be long gone and when the method
return there will be no process waiting for the answer.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
May 10 '06 #3
Hi,

There are several solutions, creating a thread is one, alternative you can
use MSMQ.

The kit of the question is how to inform the user his work was completed.
If an email a good enough answer?
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Peter Kirk" <pk@alpha-solutions.dk> wrote in message
news:OL**************@TK2MSFTNGP02.phx.gbl...
Hi

I have an asp with a single button. This invokes a method in one of my
classes which performs a terribly long process - can take 15 or 20
minutes. What is the best way to handle this sort of situation? If I just
call my long method then the browser eventually times out. Can I start a
thread instead, and return immediately to the browser (or does the thread
die almost immediately when the button handling ends and the response is
sent to the browser)?
Thanks,
Peter

May 10 '06 #4
Here is an example of how to implement a processing screen that is returned
to the browser in between and checks the status periodically
http://www.codeproject.com/aspnet/As...ingMessage.asp. This should
deal with any issues you are having.

Cheers,

Greg Young
MVP - C#
"Peter Kirk" <pk@alpha-solutions.dk> wrote in message
news:OL**************@TK2MSFTNGP02.phx.gbl...
Hi

I have an asp with a single button. This invokes a method in one of my
classes which performs a terribly long process - can take 15 or 20
minutes. What is the best way to handle this sort of situation? If I just
call my long method then the browser eventually times out. Can I start a
thread instead, and return immediately to the browser (or does the thread
die almost immediately when the button handling ends and the response is
sent to the browser)?
Thanks,
Peter

May 10 '06 #5

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

Similar topics

5
by: PontiMax | last post by:
Hi, when I press the OK button of my dialog box a long-running task is initiated. Therefore I would like to make visible a div section right after clicking the button where a user-friendly...
18
by: Larry Herbinaux | last post by:
I'm having issues with garbage collection with my long-standing service process. If you could review and point me in the right direction it would be of great help. If there are any helpful...
1
by: Anonieko | last post by:
Query: How to display progress bar for long running page Answer: Yet another solution. REFERENCE: http://www.eggheadcafe.com/articles/20050108.asp My only regret is that when click the...
14
by: lmttag | last post by:
Hello. We're developing an ASP.NET 2.0 (C#) application and we're trying to AJAX-enable it. We're having problem with a page not showing the page while a long-running process is executing. So,...
4
by: commander_coder | last post by:
Hello, I write a lot of CGI scripts, in Python of course. Now I need to convert some to long-running processes. I'm having trouble finding resources about the best practices to do that. ...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
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...
1
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...
0
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,...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.