Save frames state before refresh

Imagine diving into a framed site and surf around abit. You've drilled to a page you are interested in and for one of many possible reasons (script failed...timed out search ... whatever) you hit page refresh.

The site returns to the opening page.

You swear.

Is it possible to save the state of frames...specifically, currently loaded filenames and so as to restore them if refresh is hit.

If it matters, this will be used on an ASP-based site and I wouldn't be surprised if there's an onRefresh event for IE but we'll be serving NS folk as well.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

place this code into the desired frames

<a href="javascript:location.reload()" target="_self">*desired word*</a>

it might be much to place it in each frame but its a thought and does work specifically for each frame.

juststeveAuthor Commented:
Thankx for the reply morbiusx. The way I read it your code will allow a link to reload the the given frame when a user clicks it.

What I need to deal with is the instance when a user clicks the browser's 'Refresh' button. Currently, all frames reload to the original locations. Problems arise because the user may find it difficult to re-navigate to the page they had been viewing so I want to trap the 'Refresh' button in kinda the same way as trapping the 'Back' button.


One possible solution might be in saving frame information (s.a. url of each frame loaded) into the cookie and updating this cookie info as each frame is being loaded. Your frame set doc would have to check if such cookie exists and if YES, then reconstruct the frameset using URLs in the cookie, and if NOT then use default URLs

This solution can be implemented on client or server (since you use ASP).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.