Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 30th, 2004, 09:24 AM
Authorized User
 
Join Date: Mar 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Clear Frames

I have an ASP page with 6 frames ( header & footer and 4 data frames)

Does anyone know how to either JavaScript, VBScript Hyperlinking or anything, how I can reset frames - content1, main and main2 to a blank form.

would this have to be a multiple refresh/redirect thing or is there a simple command I can use ?

Regards
Sean


 
Old March 30th, 2004, 09:31 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can do it with a hyperlink to "about:blank" specifying the frame name in the taget attribute.

Or you can use the frames collection in JS/VBS to change the location.href of each frame to about:blank, something like
parent.frames["framename"].window.location.href="about:blank"
 
Old March 30th, 2004, 09:50 AM
Authorized User
 
Join Date: Mar 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

pgtips thanks so far.. but stupid head on today...

I have added this to a script,
<SCRIPT LANGUAGE="JavaScript">
<!--
     function reset(){
     parent.frames["content1"].window.location.href="about:blank"
     parent.frames["main2"].window.location.href="about:blank"
     parent.frames["main"].window.location.href="about:blank"
     main2.refresh
}
// -->
</SCRIPT>

and called the script at the point I need to refresh.. by <% resetscreen = "reset()"%>

but nothing draws a blank apart from my brain......

Quote
You can do it with a hyperlink to "about:blank" specifying the frame name in the taget attribute.
Unquote

Can you do multiple frames in one hyperlink ?




 
Old March 30th, 2004, 10:39 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Is the page fully loaded at the point when you call the reset() method? Sometimes there are probs when its not coz not all the objects are available.

I assume your script is in one of the pages within the frameset?

What happens when you do things like this:
alert(parent.frames); // should get "[object]"
alert(parent.frames['content1']); // should get "[object]"
alert(parent.frames['content1'].window); // should get "[object]"
alert(parent.frames['content1'].window.location.href); // should get current url
 
Old March 30th, 2004, 02:19 PM
Authorized User
 
Join Date: Mar 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

PG
I got it in the end,
bit to do with the way I was calling the statement,
I moved it right to the end and found the correct way to call it ( well the way that worked anyway....)

Thanks, this has helped a lot..








Similar Threads
Thread Thread Starter Forum Replies Last Post
How to clear to datagrid? baties General .NET 1 August 29th, 2007 06:23 AM
How to clear history toshi Javascript 0 August 17th, 2006 06:07 AM
Clear the Clipboard vb certified VB.NET 0 July 11th, 2006 07:31 PM
clear array darkhalf Javascript 2 October 30th, 2005 06:50 AM
Help me clear out Stress ! minhtri J2EE 12 November 9th, 2004 10:49 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.