I used an iframe to embed my visualforce page in a lightning component, but the page is showing me the error: Refused to display, in a frame because it set 'X-Frame-Options' to 'deny'. is this because my VF page is calling web services? if so, what could be done?


1 Answer 1


Use this:

<aura:component implements="flexipage:availableForAllPageTypes"

    <aura:attribute name="vfHost" type="String"

    <iframe aura:id="vfFrame" src="{!'https://' + v.vfHost + '/apex/myvfpage'}"/>


I have tried embedding a visualforce inside a lightning component and also tried sending data from Lightning to Visualforce. In case you need it, here's a reference: Communicating between Lightning Components and Visualforce Pages

You must log in to answer this question.