Click here to Skip to main content
15,913,941 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
How to create a website with two frames in which one contains google domain and localhost as the other using frameset(not iFrame).
Please help me with the full code
Thanks in advance.
Posted
Comments
CHill60 1-Apr-15 3:22am    
"Please help me with the full code" ... that is not how this forum works. If you have something you are stuck with then post your code and explain what the problem is, otherwise you need to pay people for stuff like that.
Raghu S Gowda 1-Apr-15 4:58am    
Thank you Chill60.

This is the issue i'm facing could you help me,

This is the error im getting in Google console:

Unsafe JavaScript attempt to initiate navigation for frame with URL 'http://localhost:5199/default.aspx' from frame with URL 'https://www.google.co.in'. The frame attempting navigation is neither same-origin with the target, nor is it the target's parent or opener.

Uncaught SecurityError: Blocked a frame with origin "http://google.co.in" from accessing a frame with origin "http://localhost:5199". Protocols, domains, and ports must match.

1 solution

Upload your webpage in both domains through ftP..
 
Share this answer
 
Comments
Raghu S Gowda 1-Apr-15 23:52pm    
This is my Code please suggest me what changes should i make to work google in that iframe.

default.aspx(start page)


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<frameset cols="80%,20%">
<frame src="frame1.aspx"></frame>
<frame src="frame2.aspx"></frame>
</frameset>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>


frame1.aspx


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="frame1.aspx.cs" Inherits="frame1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<iframe name="myframe" src="http://www.google.com" seamless sandbox id="myframe" width="1240" height="780"></iframe>
</body>
</html>


frame2.aspx


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="frame2.aspx.cs" Inherits="Login1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.auto-style1 {
position: relative;
left: 20px;
top: 0px;
width: 136px;
}
.auto-style2 {
margin-left: 14px;
}
.auto-style3 {
animation: backwards;
color: red;
position: relative;
left: 34px;
top: 16px;
width: 231px;
height: 23px;
}
</style>
</head>
<body>
<frameset border="1" frameborder="1" framespacing="0" cols="80%,20%">
<frame name="leftframe" />
<frame name="rightframe" scrolling="no" >
<form id="form1" runat="server" draggable="false">
<div id="d1" class="auto-style3">

</div>
<br />
<br />
<div>
<asp:Panel ID="Panel1" runat="server">
<asp:Label ID="lbl2" CssClass="l2" Text="UserName" runat="server" />
<asp:TextBox runat="server" ID="username" CssClass="auto-style2" Width="136px" />
<br /><br />
<asp:Label ID="lbl3" CssClass="l2" Text="Password" runat="server" />
<asp:TextBox runat="server" ID="password" CssClass="auto-style1" />
<br /><br />
<asp:Button ID="btn" Text="Login" OnClick="btn_Click" runat="server" CssClass="buttonclass" />
         
<asp:Button ID="btn1" Text="Clear" OnClick="btn1_Click" runat="server" CssClass="buttonclass"/>

</div>
</form></frame>
</frameset>
</body>
</html>



frame2.aspx.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


public partial class Login1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void btn_Click(object sender, EventArgs e)
{
if (username.Text == "admin")
{
Session["Username"] = username.Text;
Response.Redirect("Progress.aspx");
}
else
{
Response.Redirect("Login1.aspx");
}
}
protected void btn1_Click(object sender, EventArgs e)
{
username.Text = " ";
password.Text = " ";
}
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900