Retaining IFRAME Contents after Postback

Please can someone advise the best way of retaining the contents of an IFRAME within a form when the form is posted back.  The IFRAME is built from scratch so loses its contents (specifically values within a form within the IFRAME).  

I suppose that it may be possible to use an event (which one would track immediately before Postback or do I need an OnClick/Change for every element which generates a PostBack?) and then javascript to read the IFRAME form contents into something (session variables) and stick them back in later but this seems a long way around it!!

Many thanks for your time.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

I think your long way around is your best bet.

Since the IFrame cannot tell when the parent is going to postback there is no real way for it to handle itself. You can run a javascript function called on the onunload event and then handle it from there.

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.