I have created a website using a master page. One of the links within the master page is for Googles website. I can display the google website within the master page by inserting the website within a Iframe, but the problem is when I do a search in google and I click on the links some of the links within google do not open. After some reading I find that some websites do not allow their sites to open within an iframe “You have to check for HTTP response header X-Frame-Option of those sites. if its value is “DENY or SAMEORIGIN”, then you can not load those website in the iframes.”.
So does anyone know of another way to display an outside website within a master page?
This is my content page
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="Google.aspx.cs" Inherits="OnCallWeb.Google" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
<p>
<iframe src="https://www.google.com/webhp?igu=1" style="width:100%;height:700px;"></iframe>
</asp:Content>
This is on my master page.
<li><a href="<%=ResolveUrl("~/Google.aspx")%>">Google</a></li>
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Found Google no longer supports Iframes
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0