function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
rebvijkumrebvijkum 

This content cannot be displayed in a frame

I'm opening a VFP2 in a frame in VFP1. In VFP2 i hava an enhanced list. when i click on edit it shows the error"This content cannot be displayed in a frame". please i need help

VFP1:
<apex:page sidebar="false" showHeader="true"  id="page" title="Quest">
    <script language="JavaScript" type="text/javascript">    
    function cleariFrame(source){        
        if(source == '')
        {
            var iframe = document.getElementById('questframe').src="";     
        }else{
            var iframe = document.getElementById('questframe').src=""; 
            var iframe = document.getElementById('questframe').src=source;
        }        
    }
    </script>
    <apex:tabPanel selectedTab="News" id="QuestTabPanel"  tabClass="activeTab" inactiveTabClass="inactiveTab"  switchType="client">
        <apex:tab label="News" name="News" id="tab1" ontabenter="cleariFrame('/apex/QNewsList_VFP')"/>
    </apex:tab>
</apex:tabpanel>
<apex:iframe id="questframe" src="/apex/QNewsList_VFP" scrolling="true"/>
</apex:page>

VFP2:
<apex:page sidebar="false">
    <script language="JavaScript" type="text/javascript">  
            if (window.location != window.parent.location) {        
                document.getElementById('AppBodyHeader').style.display = "none";
                document.getElementById('sidebarCell').style.display = "none";               
            }     
    </script>
    <apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"/>
    <script>
        j$ = jQuery.noConflict();
        j$(document).ready(function() {
        j$('.bPageFooter').hide();
        });
    </script>
    <apex:enhancedList type="QNews__c" height="500" rowsPerPage="10" id="QNewsList"   />
</apex:page>
                                          
Best Answer chosen by rebvijkum
SonamSonam (Salesforce Developers) 
 Could you please check if  Session settings >Clickjack Protection  is enabled in your ORG?

If enabled try to disable and carry out the same steps and see if this fixes te issue...Though this is a security feature, however, it will affect the way frames can be implmented in your ORG.

read more in detail on the below link:
https://help.salesforce.com/apex/HTViewHelpDoc?id=siteforce_clickjacking_enable.htm&language=en_US