Tijo  Johnson C

Tijo Johnson C

  • NA
  • 136
  • 8.8k

How to trigger button click located outside an iframe

Apr 27 2020 2:14 AM
How to trigger button click located outside an iframe from inside the iframe by communication between two cross platform applications.
Communication between two applications, Angular application open ASP.NET web form application inside Kendow window containing iframe.From ASP.NET application want to click the button id=btnClose by Javascript.
 
**Angular form**
<kendo-window id="winID" >
<iframe width="100%" id="iframe" #iframe [src]="urlSafe"></iframe>
<button class="k-button close-button" id="btnClose" (click)="CloseClick()">Close</button>
</kendo-window>
 
**ASP.NET Webform**
function FoCloseClcik() {
var win = window.parent.document.getElementById('winID');
var btnClose = window.parent.document.getElementById('btnClose');// Getting conole output as "<button _ngcontent-rvc-c1="" class="k-button close-button" id="btnClose">Close</button>"
}
 
//Should click this button from this javascript function and effect on anugular pplication kendow-window contains button 
 

Answers (1)