473,385 Members | 1,693 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,385 software developers and data experts.

difficultly stopping execution with a cancel button

I have a buffered page that runs some code and outputs to the user to
update the progress of a method that takes several minutes to run. I
have a big problem however. There is no way to stop the code from
running once it begins. If you place a button on the page with code
that will trigger the method to stop, the button click event will not
fire until the long method completes. As a result, I can not think of
a way to create a cancel button. Has anyone had this problem before
and have a solution? Any help is greatly appreciated.

Alex

Dec 25 '05 #1
2 1389
You might try running your process in some other thread so that it does not
block ASP.NET. What you could then do is store a reference to the thread in
a session variable so that when you click the button and the handler is
invoked, you can then access the thread and stop it. I have never done this
so I don't know if it will work, but you can try it.

<al*************@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I have a buffered page that runs some code and outputs to the user to
update the progress of a method that takes several minutes to run. I
have a big problem however. There is no way to stop the code from
running once it begins. If you place a button on the page with code
that will trigger the method to stop, the button click event will not
fire until the long method completes. As a result, I can not think of
a way to create a cancel button. Has anyone had this problem before
and have a solution? Any help is greatly appreciated.

Alex

Dec 25 '05 #2
I tried using a delegate to run the procedure asynchronously but as
soon as the page_load event ends so does my thread. Is there some way
to keep the thread from aborting?

Dec 25 '05 #3

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

Similar topics

5
by: MLH | last post by:
Having identified a A97 bug in which acDialog causes undesirable side effects processing the opened form, I would like to replace the following code running in MyForm ... DoCmd.OpenForm...
5
by: Oenone | last post by:
I have a VB.NET form which I'm displaying modally using the ShowDialog() method. Within the form is a Cancel button, and I've set this button into the Form's CancelButton property so that...
1
by: Selva Chinnasamy | last post by:
I have read large amount of data from Ms-Access database to build BinaryArray. I like to know how can I stop the current execution after it is statrted. Functions build the Binary array is not...
4
by: PW | last post by:
Hi, I want to add code to check if the user wants to save the record (fields are unbound) when they press the form's close (X) button. Is it possible to return the user to the form if there...
2
by: Mark | last post by:
I have a form with two sub forms. The form is set to data entry. The form is bound directly to a table I have two buttons at the bottom of the screen. One button is named reject and one is named...
4
by: bjm | last post by:
I am writing a program that will automate a series of application installations. I want to give the user the option of stopping the program's execution in between installations (for example, give...
0
oll3i
by: oll3i | last post by:
import javax.swing.*; import java.awt.event.*; import java.util.ArrayList; import java.util.List; import java.util.concurrent.*; import java.lang.reflect.*; public class Exec1 extends JFrame...
4
by: MaxMax | last post by:
I have a dialog box with a Cancel button that I want to be activable with the ESC key. In the form the Cancel button is connected to the CancelButton property. Now my problem is that the OnClick...
4
by: sphinney | last post by:
Hi everyone. I'm creating an application inside Access 2007. The application will retrieve data from various locations on my company's network servers. Depending on the time of day, alignment of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.