PC Review


Reply
Thread Tools Rate Thread

code execution flow

 
 
=?Utf-8?B?Sm8=?=
Guest
Posts: n/a
 
      19th May 2004
Hi,

I have a small (hopefully!) problem. I have two buttons on my web page and when button A is clicked, the code behind takes about 3 seconds to execute. While it's executing though, I don't want the user to be able to click button B. What I have found happens is that if user clicks button B while button A is still executing, the code behind button B will start executing straight after the code under A has finished, and there is no page refresh/reload in between the two executions - that is my main problem.
I have searched the web to try to find a solution but have been unsuccessful. Can anyone tell me how I can either make button B disabled in the middle of button A's code execution (so once A is clicked, disable B, refresh the page and continue with execution of code under A), or end all code execution once the code under A has finished (ie do not go on to code under button B if it was pressed)?

Thanks for your help - greately appreciate it,

Jo
 
Reply With Quote
 
 
 
 
Mary Chipman
Guest
Posts: n/a
 
      19th May 2004
Does A always get pressed before B? If so, then open the page with B
disabled or hidden, and enable/unhide it in A's code.

--Mary

On Tue, 18 May 2004 19:36:02 -0700, "Jo"
<(E-Mail Removed)> wrote:

>Hi,
>
>I have a small (hopefully!) problem. I have two buttons on my web page and when button A is clicked, the code behind takes about 3 seconds to execute. While it's executing though, I don't want the user to be able to click button B. What I have found happens is that if user clicks button B while button A is still executing, the code behind button B will start executing straight after the code under A has finished, and there is no page refresh/reload in between the two executions - that is my main problem.
>I have searched the web to try to find a solution but have been unsuccessful. Can anyone tell me how I can either make button B disabled in the middle of button A's code execution (so once A is clicked, disable B, refresh the page and continue with execution of code under A), or end all code execution once the code under A has finished (ie do not go on to code under button B if it was pressed)?
>
>Thanks for your help - greately appreciate it,
>
>Jo


 
Reply With Quote
 
=?Utf-8?B?Sm8=?=
Guest
Posts: n/a
 
      20th May 2004

I wish it was that easy - B can (and in most cases will) be pressed before A. It could be pressed 10 times before A is pressed.
----- Mary Chipman wrote: -----

Does A always get pressed before B? If so, then open the page with B
disabled or hidden, and enable/unhide it in A's code.

--Mary

On Tue, 18 May 2004 19:36:02 -0700, "Jo"
<(E-Mail Removed)> wrote:

>Hi,
>>I have a small (hopefully!) problem. I have two buttons on my web page and when button A is clicked, the code behind takes about 3 seconds to execute. While it's executing though, I don't want the user to be able to click button B. What I have found happens is that if user clicks button B while button A is still executing, the code behind button B will start executing straight after the code under A has finished, and there is no page refresh/reload in between the two executions - that is my main problem.

>I have searched the web to try to find a solution but have been unsuccessful. Can anyone tell me how I can either make button B disabled in the middle of button A's code execution (so once A is clicked, disable B, refresh the page and continue with execution of code under A), or end all code execution once the code under A has finished (ie do not go on to code under button B if it was pressed)?
>>Thanks for your help - greately appreciate it,
>>Jo



 
Reply With Quote
 
Mary Chipman
Guest
Posts: n/a
 
      20th May 2004
Unfortunately, the code has to complete before the refreshed page is
returned to the user. Perhaps you could create additional controls so
that the application flows more smoothly? It's hard to visualize
without seeing it and understanding the process, but you probably need
to re-design the UI to take into account your workflow.

--Mary

On Wed, 19 May 2004 16:11:02 -0700, "Jo"
<(E-Mail Removed)> wrote:

>
> I wish it was that easy - B can (and in most cases will) be pressed before A. It could be pressed 10 times before A is pressed.
> ----- Mary Chipman wrote: -----
>
> Does A always get pressed before B? If so, then open the page with B
> disabled or hidden, and enable/unhide it in A's code.
>
> --Mary
>
> On Tue, 18 May 2004 19:36:02 -0700, "Jo"
> <(E-Mail Removed)> wrote:
>
> >Hi,
> >>I have a small (hopefully!) problem. I have two buttons on my web page and when button A is clicked, the code behind takes about 3 seconds to execute. While it's executing though, I don't want the user to be able to click button B. What I have found happens is that if user clicks button B while button A is still executing, the code behind button B will start executing straight after the code under A has finished, and there is no page refresh/reload in between the two executions - that is my main problem.

> >I have searched the web to try to find a solution but have been unsuccessful. Can anyone tell me how I can either make button B disabled in the middle of button A's code execution (so once A is clicked, disable B, refresh the page and continue with execution of code under A), or end all code execution once the code under A has finished (ie do not go on to code under button B if it was pressed)?
> >>Thanks for your help - greately appreciate it,
> >>Jo

>
>


 
Reply With Quote
 
=?Utf-8?B?Sm8=?=
Guest
Posts: n/a
 
      21st May 2004
So there's no way that in my code (at the end of a button click function) I can force the page to refresh without executing any further code (which is the next button click waiting to be executed)

 
Reply With Quote
 
Mary Chipman
Guest
Posts: n/a
 
      24th May 2004
When you click the button, there's only 1 round trip to the server,
where the code is executed, and the refreshed page returned. What you
are asking would require two round trips, which is why I suggested
re-examining your workflow and UI to account for this.

--Mary

On Thu, 20 May 2004 20:01:05 -0700, "Jo"
<(E-Mail Removed)> wrote:

>So there's no way that in my code (at the end of a button click function) I can force the page to refresh without executing any further code (which is the next button click waiting to be executed)?


 
Reply With Quote
 
=?Utf-8?B?Sm8=?=
Guest
Posts: n/a
 
      25th May 2004
Thanks for your replies and your patience :-)
If you look at the Hotmail website (once you log in), they are doing exactly what I'd like to do. Ie when you press a button on that page, for example NewMessage, the page then begins to load, and you are unable to press any buttons on the page while it's loading - as if they were all disabled. This is what I need to achieve. Any idea how they might be doing that?
 
Reply With Quote
 
Mary Chipman
Guest
Posts: n/a
 
      25th May 2004
Not being unfamiliar with Hotmail internals, I would guess that
they're running client-side script.

--Mary

On Mon, 24 May 2004 19:56:04 -0700, "Jo"
<(E-Mail Removed)> wrote:

>If you look at the Hotmail website (once you log in), they are doing exactly what I'd like to do. Ie when you press a button on that page, for example NewMessage, the page then begins to load, and you are unable to press any buttons on the page while it's loading - as if they were all disabled. This is what I need to achieve. Any idea how they might be doing that?


 
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
Spot the bug (three line program) and a question on how to order execution flow in a OOP raylopez99 Microsoft C# .NET 23 5th Oct 2007 01:13 AM
Execution flow Bill Microsoft Access Form Coding 5 27th Jan 2006 10:35 AM
Re: Flow chart of code? Is there a way to produce a graphical flow chart? Trevor Shuttleworth Microsoft Excel Programming 0 22nd Aug 2005 10:31 PM
Design flow for Code-behind tshad Microsoft ASP .NET 17 2nd Mar 2005 10:25 PM
code runs well on 3rd execution after getting Error: 3021 on 1st 2 execution =?Utf-8?B?eWFubg==?= Microsoft Access VBA Modules 0 23rd Mar 2004 10:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:00 PM.