View Full Version : One frame dependant on another frame's location

04-12-2005, 05:26 AM
Hello all,

I appologize for the length of this problem, but I am quite stumped.

I am currently working on a project that uses ASP for all output and a Visual Basic webbrowser control to browse. The ASP page is a basic frameset with 2 contained frame elements.

Say the frames are called "Frame1" and "Frame2" (very creative, I know). Frame1 is a navigational frame and Frame2 is the main frame. Frame1 has three images (home, back and print). Home merely redirects to index.asp in the main frame. Back is history.back() for the main frame. Print prints the contents of the main frame. Frame1 needs to see when Frame2 has changed, and if Frame2 is at a certain page, Frame1 needs to change its content. Simple in theory, I know.

How I currently have it working is like so: the webbrowser control intercepts the downloadcomplete event and then uses .document.body.frames("menu").location.href to redirect it to the navigational page (with the print image showing, or not, dependant on the location of the main frame). This works, but then if the user presses the back image in the navigational frame, it goes back a page, obviously, but the page it goes back to is the navigational page with the previous state.

In more simple terms, what I require is something that checks the location of Frame2, injects/removes the code in Frame1 accordingly, without changing the history object. (using javascript or asp, would be best)

Any help would be greatly appreciated.