CLEAR DIALOG iFrame

Hello there,

I am working on this project where I have Modal Popup windows whose content is from iFrame and they get data from code behind. The challenge I have is that I want to clear the iframe content onClose of the modal window.

See my code below. It has the HOME.aspx  page which acts as a landing page and 3 Pages which are used a iFrame pages.

WebForm1.aspx
WebForm2.aspx
WebForm3.aspx

I tried some code that I was given on this forum but it never worked (I have used that code in WebForm1.aspx, but the behavior is not what I expected).

What I want to achieve is, when I close a window, the contents of the iFrame should be reset to the original state. i.e. if you select option 'LoadGrid' in one of the Modal Windows, it generates data for the dataGrid, but when I close and reopen the Window, the datagrid still shows the values from the OnChange event.

How can I achieve the behavior that I want....?

Thanks

Attachment: ModalProj_41465242.zip

4 Replies 1 reply marked as answer

MK Muthukrishnan Kandasamy Syncfusion Team July 7, 2020 02:41 PM UTC

Hi Joji, 
 
Thanks for contacting Syncfusion support. 
 
We have validated your requirements in Dialog with Grid control. We need some time to analyze more regarding this scenario. We’ll update the further validation details with in three business days on (July 10, 2020). 
 
We appreciate your patience until then. 
 
Regards, 
Muthukrishnan K 



MK Muthukrishnan Kandasamy Syncfusion Team July 9, 2020 02:15 PM UTC

 
Hi Joji, 
 
Thanks for being patience. 
 
We have validated your reported problem in EJ Dialog control. We have found the solution to meet your requirement. We can refresh the iframe inside the Dialog control so, that Grid and other controls will not maintain the previous state. Please refer the below code block. 
 
//dialog close event 
        function onWebFormClose() { 
            // Get the all ifram elements 
            var iframe = document.getElementsByClassName("e-iframe"); 
            for (var i = 0; i < iframe.length; i++) { 
                // reload the iframe 
                iframe[i].contentDocument.location.reload(); 
            } 
        } 
 
We have attached sample for your convenience, which can be downloaded from the below link. 
 
 
Please let us know, if you need any further assistance. 
 
Regards, 
Muthukrishnan K 


Marked as answer

JK Joji Kaju July 9, 2020 02:30 PM UTC

Hello,

Thanks for the reply. The solution worked perfectly.

Regards


MK Muthukrishnan Kandasamy Syncfusion Team July 10, 2020 04:24 AM UTC

Hi Joji, 
 
Thanks for your update. 
 
We are glad to know that given solution works. Please let us know if you need any further assistance. 
 
Regards, 
Muthukrishnan K 


Loader.
Up arrow icon