473,406 Members | 2,707 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,406 software developers and data experts.

Abort in progress bar control

Hi
I am trying to implement the Abort functionality in progress bar
control. Scenario is like this.

I have a web application which performs a very long computation
process. This computation process starts when I click calculate button
on that webworm.

On Calculate click two functionalities are implemented
1)When I click on calculate it open a progress bar pop up .This
progress bar uses JavaScript to update the status and filling up of
span to show the percentage complete
2)Also a request is being posted on to perform a long computation.

During this long wait ,if user wants to abort the computation he has to
clcik on Abort button provided on progress bar pop up. In this Abort
button functionality I call the function on main page to abort this
request. Limitations I face here are

1)This abort request is processed after computation request is
complete. So it 's of no use.
2)I used thread here to avoid this problem. But limitations I face here
are
a)My calculation process includes three steps Maping data from screen,
Perform calculations on that mapped data, Bind the calculations with
screen.
b)All the three functions described above should occur synchronously.
c)Thread method to be executed when thread starts is "Perform
calculations"
d)"BindData' function is dependent on Perform Calculations

I cannot put MapData() and BinData() in thread , as thread throws null
reference exception. It never gets the context.

Please tell me where I am going wrong or suggest a new approach to
resolve the problem.

pseudo code for help

bool ThreadCompleted = false;
protected void btnCompute_Click(sender,event Args)
{
MapDataFromScreen();
workerStart = new ThreadStart(PerformAnalysis);
workerThread = new Thread(workerStart);
workerThread.Start();
BindData();
}

private void PerformAnalysis
{
//Perform long calculations
ThreadCompleted = true;
}

private void BindData()
{
if(ThreadCompleted)
{
//Bind Grid and labels with new calculations
}
}

//This event does not get called unless the Bind Data function is
complete.How to avoid this??
protected void Abort()
{
workerThread.Abort();
}
Regards
Nidhi

Dec 26 '05 #1
0 1340

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

Similar topics

0
by: cottonviking | last post by:
Greetings, all! I'm pondering the pitfalls of aborting a secondary thread from the main thread in a service app that I'm working on in VBNET (fx 1.1). Everything I've read so far pretty much...
2
by: Drew Stoddard | last post by:
We are working in C#/Winforms and are using asynchronous client-side web service calls (the Begin... and End... methods supplied by the web reference creation). Many of these calls are contained...
20
by: Doug Thews | last post by:
I ran into an interesting re-pain delay after calling the Abort() method on a thread, but it only happens the very first time I call it. Every time afterward, there is no delay. I've got a...
18
by: Urs Vogel | last post by:
Hi I wrote an application server (a remoting sinlgeton), where processes must be stopped in very rare cases, done thru a Thread.Abort(). Occasionally, and only after a Thread.Abort(), this...
4
by: fred | last post by:
I use a Synclock in a secondary thread and also stop the thread using the abort method. If the abort occurs while the thread is in the Synclock will the SyncLock always be released before the...
0
by: nidhig | last post by:
Hi I am trying to implement the Abort functionality in progress bar control. Scenario is like this. I have a web application which performs a very long computation process. This computation...
0
by: Matt | last post by:
I'm attempting to load a form, query a database, and update a progress bar on the same form. I want the form to load and activate/enable the form's cancel button while the code continues to...
1
by: daniel_xi | last post by:
Hi all, I am running a VS 2003 .NET project on my client machine (Win 2000 SP4, ..NET framework 1.1), running an ASP.NET application on a remote web server (Win 2000 Server, IIS 6.0, .NET...
5
by: Alan T | last post by:
I will do several things in my thread: Copy a file to a location Update database record Read the file content Write the content to a log file If I call Thread.Abort(), it may be possible to...
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: 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: 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
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...
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...
0
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,...

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.