• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 781
  • Last Modified:

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.
1 Solution
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now