onStop event and what else IE is doing at the time

G

graham.bunce

Hi,

I have a .NET application which works as follows:

1) Page A is loaded
2) User enters search details, clicks search
3) Application re-directs to page B. In the page On_Load event the
search is performed (therefore the browser is still showing page A
whilst doing the search within page B)
4) Search completes within Page B page_load event, controls updated and
page_load event completes. Page B is displayed.

This is an application I have picked up - I didn't design it :)

What the user wants is for the cursor and status bar to go into
"waiting mode" (ie hourglass and appropriate text). This is done by
trapping the search button click event and using Javascript code (on
Page A).

However, if the user clicks the stop button, the cursor remains in the
hourglass - it is not reset.

I thought I could get round this by trapping the IE "onStop" event.
Unforunately I think the (well entrenched) design of doing the search
in Page B is preventing this.

I get the following IE events fired when I perform the above steps.

Page A
-----------
OnLoad
[Enter details and click search]
OnBeforeUnload
OnStop
* short pause whilst page B is doing the work *
UnLoad

Page B
----------
OnLoad


Now, if I click the IE "Stop" button whilst the search is taking place
(ie between the Page A OnStop and UnLoad) then although work is
actually stopped, the OnStop event doesn't fire (I assume because the
page is already in the process of being unloaded). It doesn't fire on
Page B either.

However, if I click "stop" twice then the second time the OnStop will
fire on Page A.

With me so far? :)

What I want to know is - just what exactly is going on !

There is no "OnBeforeLoad" event so I can't tell exactly what page IE
thinks it's on when I click the "Stop" button - but even if there was I
think the browser is in "limbo" in that Page A is not fully unloaded
and Page B is not fully loaded. Is this why the OnStop event doesn't
fire.... nothing is listening for it? I'm assuming that the first
"stop" click does reset something in IE, which is why the second click
works.....

I am a little confused and this is a detailed question so any help (or
other advice) will be greatly appreciated.

Thanks.
 
G

graham.bunce

By the way, after more testing I've realised that as it's an ASP.NET
app, whenever I click on a ASPX button control the OnBeforeUnload,
OnStop and Unload events are always fired, even if I'm not redirecting
anywhere.

Same problem though, once the OnStop event has fired once (instantly
after I click a button) clicking it once does not fire it again - it
has to be clicked twice.

Is this a bug in IE & .NET (v 1.1) ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top