adsense

Wednesday, August 30, 2017

Refused to display in a frame because it set 'X-Frame-Options' to 'DENY'

You might Sometimes encounter the error above when you are using iframes w to load resources outside from the domain.

This Issue can be fixed in two ways

1) Add this to web.config

<httpProtocol>
    <customHeaders>
      <add name="X-Frame-Options" value="AllowAll" />
    </customHeaders>
  </httpProtocol>

2) Add this to Global.asax.cs

protected void Application_PreSendRequestHeaders()
{
 Response.Headers.Remove("X-Frame-Options");
 Response.AddHeader("X-Frame-Options", "AllowAll");
}
 
Please read this discussion in stackoverflow for a detailed discussion on the topic.

Regards,
Samitha


No comments:

Post a Comment