PC Review


Reply
Thread Tools Rate Thread

Conceptual Problem

 
 
Martin Payne
Guest
Posts: n/a
 
      4th Oct 2003
Say I want to write a page that, when delivered, displays
a button labelled 'start'. When the button is pressed, a
process is initiated server-side that, say, writes random
values to a database table every second. And, at the
same time, the page no longer displays a start button but
begins displaying the contents of the database table,
refreshing every 5 seconds.

I have two questions. Firstly, how would I get an aspx
page to kick off a process and return a page before that
process is finished (the process will continue running in
the background). I've already figured how to stop the
process when needed (I just set a flag somewhere that the
process checks on each iteration, when I want the process
to stop I change the flag), I just can't figure how to
start the process and deliver a new page without waiting
for the proess to complete.

And, secondly, how do I get the page that displays the
table contents to refresh every 5 seconds?

Thanks
Martin


 
Reply With Quote
 
 
 
 
Versteijn
Guest
Posts: n/a
 
      4th Oct 2003
"Martin Payne" <(E-Mail Removed)> wrote in message news:<002e01c38a1e$cc30ad60$(E-Mail Removed)>...
> Say I want to write a page that, when delivered, displays
> a button labelled 'start'. When the button is pressed, a
> process is initiated server-side that, say, writes random
> values to a database table every second.



> And, at the
> same time, the page no longer displays a start button but
> begins displaying the contents of the database table,
> refreshing every 5 seconds.




>
> I have two questions. Firstly, how would I get an aspx
> page to kick off a process and return a page before that
> process is finished (the process will continue running in
> the background). I've already figured how to stop the
> process when needed (I just set a flag somewhere that the
> process checks on each iteration, when I want the process
> to stop I change the flag), I just can't figure how to
> start the process and deliver a new page without waiting
> for the proess to complete.


I would problably do it this way:
when the page loads , in the Page_Load event, check for a flag that
switches to true with the button is pressed, and do the random DB
process in a simple loop. Use the clock to check for seconds and do it
just 5 times (5 seconds). After that, reload the page.

This way, during postback the process will not continue however. If
that is what you really want you might want and try to find out more
about threads. But I don't think it will be easy to safely implement
it.

Freek Versteijn

>
> And, secondly, how do I get the page that displays the
> table contents to refresh every 5 seconds?
>
> Thanks
> Martin

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conceptual Problem with Monitor.Enter and Monitor.Exit AliRezaGoogle Microsoft C# .NET 12 17th Jun 2008 07:40 AM
conceptual problem Lloyd Dupont Microsoft ASP .NET 2 4th Jan 2006 01:56 PM
Conceptual Problem - Comparing data in to tables Cool Dude Microsoft Access Macros 1 11th Dec 2005 06:17 PM
Modifying Bitmaps: Conceptual problem shirsoft Microsoft VC .NET 0 31st Mar 2005 01:22 PM
Conceptual Problem with DAO/ADO Recordset Eddy Microsoft Excel Programming 0 8th Sep 2003 07:43 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:24 AM.