Retaining IFRAME Contents after Postback

Posted on 2006-04-13
Last Modified: 2012-08-13
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.
Question by:antdow
    1 Comment
    LVL 15

    Accepted 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.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now