1

I have a MVC application which I'm trying to display through an iframe.

I get following error message:

This content cannot be displayed in a frame

I've googled some and found that I should use a meta tag. I've used it in my shared layout page in my MVC project but its still not working.

<meta http-equiv="X-Frame-Options" content="allow">

Rendered HTML:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title></title>
    <meta name="viewport" content="width=device-width"/>
    <meta http-equiv="X-Frame-Options" content="allow">
</head>
<body>
</body>
</html>

My iframe:

<asp:Content ID="Content1" ContentPlaceHolderID="MainRegion" runat="server">
<div>
    <input type="hidden" name="nSystemId" value="<%= strSystemId %>" />
</div>
<iframe src="http://myServer/Project/Controller/" seamless="seamless" frameBorder="0" height="600" width="400"></iframe>    

</asp:Content>
Chris Pratt
  • 232,153
  • 36
  • 385
  • 444
MrProgram
  • 5,044
  • 13
  • 58
  • 98
  • Well, what actually *is* the content that your attempting to load? – Chris Pratt Oct 29 '15 at 15:27
  • 1
    @ChrisPratt Some forms etc.. I did found my answer here: http://stackoverflow.com/questions/20254303/mvc-5-prevents-access-to-content-via-iframe – MrProgram Oct 30 '15 at 08:49
  • 1
    Found answer here: http://stackoverflow.com/questions/20254303/mvc-5-prevents-access-to-content-via-iframe – MrProgram Oct 30 '15 at 08:51

0 Answers0