Enable iframe in asp.net application

1

I have an asp.net application and need to place it inside an Iframe.

It turns out to be wrong on the Chrome console:

Refused to display 'domain' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

In mozilla it does not give error, and also does not show anything.

WebConfig looks like this:

 <httpProtocol>
  <customHeaders>
   <add name="Access-Control-Allow-Origin" value="*" />
  </customHeaders>
 </httpProtocol>

I do not know what to do.

    
asked by anonymous 03.06.2016 / 22:34

1 answer

0

At your% w /%, set the following:

protected void Application_PreSendRequestHeaders()
{
    Response.Headers.Remove("X-Frame-Options");
    Response.AddHeader("X-Frame-Options", "AllowAll");
}

ASP.NET MVC applications are not configured by default to appear in Global.asax.cs .

    
03.06.2016 / 23:21