Board index » Visual Studio » How do I access frameproperties in vb.net?

How do I access frameproperties in vb.net?

Visual Studio133
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

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="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="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="schemas.microsoft.com/intellisense/ie5">

</HEAD>

<body>

<form id="Form1" method="post" runat="server">

<P>

<asp:TextBox id="txtUrlToOpen"

runat="server">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


-
 

Re:How do I access frameproperties in vb.net?

Hi Bengt,



This is not a standard feature from aspx.

(This version from Net is frameless with aspx pages, of course you can do it

with HTML).



However I have seen answers on this questions to simulate it in the

newsgroup



microsoft.public.dotnet.aspnet



Maybe you can search it or ask it there also.



I hope you find your solution.



Cor





-