How do I access frameproperties in vb.net?

Discussion in 'ASP .Net' started by Bengt-Erik Eliasson, Apr 23, 2004.

  1. 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
    Bengt-Erik Eliasson, Apr 23, 2004
    #1
    1. Advertising

  2. use client side JavaScript

    The solution is to use client side JavaScript.
    --
    Peter O'Reilly
    Peter O'Reilly, Apr 23, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    2
    Views:
    540
    Guest
    Feb 2, 2004
  2. Guest
    Replies:
    0
    Views:
    504
    Guest
    Feb 9, 2004
  3. Bengt-Erik Eliasson

    How do I access frameproperties in vb.net?

    Bengt-Erik Eliasson, Apr 26, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    400
    Bengt-Erik Eliasson
    Apr 26, 2004
  4. Ros@
    Replies:
    3
    Views:
    622
  5. =?Utf-8?B?a21jY29za2V5?=

    ACCESS AN ACCESS DATABASE FROM ASP.NET INTRANET SCENARIO

    =?Utf-8?B?a21jY29za2V5?=, Apr 24, 2007, in forum: ASP .Net
    Replies:
    7
    Views:
    466
    =?Utf-8?B?a21jY29za2V5?=
    Apr 30, 2007
Loading...

Share This Page