How do I access frameproperties in vb.net?

  • Thread starter Bengt-Erik Eliasson
  • Start date
B

Bengt-Erik Eliasson

Hello!
In my mainpage i have two frames (MENU and MAIN). In the MAIN I load another
page with frames (Sub_Frame.htm). It contains TOP and BOTTOM frame. In
BOTTOM frame I have a page with a button (Result.aspx). What I want to do is
from that button, change the SRC in a frameset two levels up (SRC for MAIN
frame in Main_Frame.aspx should be changed from Sub_Frame.aspx to
http://www.gotdotnet.com). How do I achieve this?

Best regards
/ Bengt-Erik

Main_Frame.htm:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<title>Contents Frameset</title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
</head>
<frameset cols="150,*">
<frame name="menu" src="Menu.aspx">
<frame name="main" src="Sub_Frame.htm">
<noframes>
<p id="p1">
This HTML frameset displays multiple Web pages. To view this frameset,
use a
Web browser that supports HTML 4.0 and later.
</p>
</noframes>
</frameset>
</html>

Sub_Frame.htm:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<title>Horizontal Split Frameset</title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
</head>
<frameset rows="*,*">
<frame name="top" src="Search.aspx">
<frame name="bottom" src="Result.aspx">
<noframes>
<p id="p1">
This HTML frameset displays multiple Web pages. To view this frameset,
use a
Web browser that supports HTML 4.0 and later.
</p>
</noframes>
</frameset>
</html>

Result.aspx:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Result.aspx.vb"
Inherits="localhost.Result"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Result</title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<P>
<asp:TextBox id="txtUrlToOpen"
runat="server">http://www.gotdotnet.com/</asp:TextBox></P>
<P>
<asp:Button id="btnOpenUrl" runat="server" Text="Open URL in main
window"></asp:Button></P>
</form>
</body>
</HTML>

Result.aspx.vb:
Public Class Result
Inherits System.Web.UI.Page
Protected WithEvents txtUrlToOpen As System.Web.UI.WebControls.TextBox
Protected WithEvents btnOpenUrl As System.Web.UI.WebControls.Button
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub btnOpenUrl_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnOpenUrl.Click
'Here is the thing I wan't to achieve...
'Parent.Parent.Frames("main").Src = txtUrlToOpen.Text
End Sub
End Class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top