[thelist] Sharing data between ASP and JavaScripts

jerryscannell at cox.net jerryscannell at cox.net
Wed Feb 26 14:48:01 CST 2003


David and Hassan,

Here's what I tried:

I added a link on my "left" frame which runs an .asp file whose sole lot in life is to do whatever works to stop the reporting!  I wasn't sure what to do at the end of it.  I tried doing a response.redirect back to the home page??  That worked but the process was still running.  I did nothing and all I got was a white window.

I have tried (and failed) with the following:

1. Set a session variable to "cancel". The reporting module checks for it at the end of the do ... loop. The reporing loop never saw the change in the session variable's value.

2.  I then decided to create a little text file if you click on the "cancel".  The do ... loop merely checks for the existence of the file and then quits.  That didn't seem to work, either.

3.  Not convinced that doing the response.redirect out of the cancel process wasn't the problem, I decided to make the cancel process open up in its own window (target=top).  The window opened but nothing seemed to be happening.  Meanwhile my reporting module is churning away (I added a debug statement that displayed "run" or "Cancel" depending on the discovery of the file)

The cancel window finally executed but not until after the report was complete!

Is there a way to make this process run right away??  I truly think that either setting a session variable or creating a small file should work,  But it seems I am treading on some new turf here...

Jerry

>
> From: David.Cantrell at Gunter.AF.mil
> Date: 2003/02/26 Wed PM 02:25:58 EST
> To: thelist at lists.evolt.org
> Subject: RE: [thelist] Sharing data between ASP and JavaScripts
>
> > Sure. The two frames contain independent documents; the fact
> > that the 'main' frame is waiting for the response from the
> > server with the query results doesn't preclude your making a
> > request from the 'left' frame. Skip the JavaScript, just make
> > the button a link to the variable-setting process. In JSP,
> > it'd be something as simple as a page with <%
> >     session.setAttribute("IMPATIENCE_FLAG", true);
> >     response.sendRedirect(request.getHeader("REFERER"));
> > %>
>
> DOH!! This might actually work! <slaps-forhead/>
>
> I haven't used frames in *years* (five or six now) so I completely missed
> this approach.
>
> If you have the long-running process periodically check that session
> variable... Hmm...
>
> [start]
> Session ( "cancel" ) = false
>
> [user fires report]
> Session ( "cancel" ) = false  'still
>
> [user changes mind, hits cancel button in control frame]
> Session ( "cancel" ) = true
>
> [report generator checks session]
> While generatingReport
> 	Every 60 Seconds:
> 		If Session ( "cancel" ) then
> 			TERMINATE REPORT
> 		End If
> Wend
>
>
> Dang, that's a good idea -- I'll have to stash that one away for future use!
> :)
>
> And I'm still technically right -- this just hacks around it using two
> document instances in a single browser, so there! ;)
>
> -dave
> --
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>




More information about the thelist mailing list