ASP.Net 2.0 frm2 Inherits frm1

Discussion in 'ASP .Net' started by =?Utf-8?B?Um9iZXJ0byBCaW5kaW5p?=, Aug 9, 2005.

  1. Hi
    with visual studio 2005 beta 2 i have created two form:
    frm1 (Inherits System.Web.UI.Page)
    frm2 (Inherits frm1)

    but in the line code :
    Inherits frm1
    vs send error: type frm1 is not defined



    ***** frm1.aspx *****
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="frm1.aspx.vb"
    Inherits="frm1" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>frm1 Page</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    </div>
    </form>
    </body>
    </html>

    ***** frm1.aspx.vb *****
    Partial Class frm1
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles Me.Load
    Me.TextBox1.Text = "Prova"
    End Sub
    End Class



    ***** frm2.aspx *****
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="frm2.aspx.vb"
    Inherits="frm2" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>frm2 Page</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>

    </div>
    </form>
    </body>
    </html>


    ***** frm2.aspx.vb *****
    Partial Class frm2
    Inherits frm1 'error: type frm1 is not defined

    End Class


    Where is the error!
    Thanks!!!
    =?Utf-8?B?Um9iZXJ0byBCaW5kaW5p?=, Aug 9, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?Um9iZXJ0byBCaW5kaW5p?=

    Brock Allen Guest

    On frm2.aspx add:
    <%@ Reference Page="frm1.aspx" %>

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > Hi
    > with visual studio 2005 beta 2 i have created two form:
    > frm1 (Inherits System.Web.UI.Page)
    > frm2 (Inherits frm1)
    > but in the line code :
    > Inherits frm1
    > vs send error: type frm1 is not defined
    > ***** frm1.aspx *****
    > <%@ Page Language="VB" AutoEventWireup="false" CodeFile="frm1.aspx.vb"
    > Inherits="frm1" %>
    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    > "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    >
    > <html xmlns="http://www.w3.org/1999/xhtml" >
    > <head runat="server">
    > <title>frm1 Page</title>
    > </head>
    > <body>
    > <form id="form1" runat="server">
    > <div>
    > <asp:Label ID="Label1" runat="server"
    > Text="Label"></asp:Label>
    > <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    > </div>
    > </form>
    > </body>
    > </html>
    >
    > ***** frm1.aspx.vb *****
    > Partial Class frm1
    > Inherits System.Web.UI.Page
    > Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    > System.EventArgs) Handles Me.Load
    > Me.TextBox1.Text = "Prova"
    > End Sub
    > End Class
    > ***** frm2.aspx *****
    > <%@ Page Language="VB" AutoEventWireup="false" CodeFile="frm2.aspx.vb"
    > Inherits="frm2" %>
    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    > "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    >
    > <html xmlns="http://www.w3.org/1999/xhtml" >
    > <head runat="server">
    > <title>frm2 Page</title>
    > </head>
    > <body>
    > <form id="form1" runat="server">
    > <div>
    > </div>
    > </form>
    > </body>
    > </html>
    >
    > ***** frm2.aspx.vb *****
    > Partial Class frm2
    > Inherits frm1 'error: type frm1 is not defined
    > End Class
    >
    > Where is the error! Thanks!!!
    >
    Brock Allen, Aug 9, 2005
    #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. Alex Nitulescu
    Replies:
    0
    Views:
    341
    Alex Nitulescu
    Feb 22, 2005
  2. CsaaGuy
    Replies:
    2
    Views:
    970
    Mythran
    Jul 13, 2005
  3. z f
    Replies:
    1
    Views:
    8,183
    =?Utf-8?B?RFdT?=
    Mar 1, 2006
  4. Mufasa
    Replies:
    1
    Views:
    361
    Andrew Morton
    Mar 12, 2009
  5. ton
    Replies:
    1
    Views:
    1,002
    Teemu Keiski
    Jun 24, 2007
Loading...

Share This Page