Problem sending values from one page to another (pepehammer)

Discussion in 'ASP .Net' started by Marcelo, Jan 22, 2004.

  1. Marcelo

    Marcelo Guest

    Hi guys, I'm using the following code to send values from one page to
    another, but seems to me, that the event Page_Load in the receiving page
    never fires.
    Why?

    This is the code:

    Thanks

    -*-*-*-*-*-*

    PAGE SENDING THE INFORMATION


    <%@ Page Language="vb" AutoEventWireup="false" Codebehind="PageSend.aspx.vb"
    Inherits="Testing.WebForm1" ClassName="classPageSend"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <title>WebForm1</title>
    <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
    <meta content="JavaScript" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5"
    name="vs_targetSchema">
    <!-- This is the script containig the logic to send -->
    <!-- variable information from one page to another -->
    <!-- THis is declared between the <HEAD> tag -->
    <script language="vb" runat="server">

    Public ReadOnly Property FirstName() as String
    Get
    Return txtFirstName.Text
    End Get
    End Property

    Public ReadOnly Property LastName() as String
    Get
    Return txtLastName.Text
    End Get
    End Property

    Sub ButtonClicked(sender As Object, e As EventArgs )
    Server.Transfer("PageReceive.aspx")
    End Sub

    </script>
    </HEAD>
    <body MS_POSITIONING="GridLayout">
    <form id="Form1" method="post" runat="server">
    <asp:textbox id="txtFirstName" style="Z-INDEX: 101; LEFT: 72px; POSITION:
    absolute; TOP: 72px"
    runat="server"></asp:textbox><asp:textbox id="txtLastName"
    style="Z-INDEX: 102; LEFT: 72px; POSITION: absolute; TOP: 104px"
    runat="server"></asp:textbox><asp:button id="btnSend" style="Z-INDEX:
    103; LEFT: 72px; POSITION: absolute; TOP: 144px" onclick="ButtonClicked"
    runat="server" Text="Send"></asp:button></form>
    </body>
    </HTML>



    PAGE RECEIVING THE INFORMATION

    <%@ Page Language="vb" AutoEventWireup="false"
    Codebehind="PageReceive.aspx.vb" Inherits="Testing.PageReceive" %>
    <%@ Reference Page="PageSend.aspx"%>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <title>PageReceive</title>
    <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
    <meta content="JavaScript" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5"
    name="vs_targetSchema">

    <script language="VB" runat="server">

    Protected classPage as classPageSend

    Sub Page_Load()

    Response.Write("Say this")

    If Not IsPostBack then
    classPage = CType(Context.Handler, classPageSend)
    lblName.Text = "aaaa" 'classPage.FirstName
    Response.Write("Say that")
    End if

    End Sub

    </script>
    </HEAD>
    <body MS_POSITIONING="GridLayout">
    <form id="Form1" method="post" runat="server">
    <asp:label id="Label1" style="Z-INDEX: 101; LEFT: 24px; POSITION:
    absolute; TOP: 40px" runat="server">Shows the Values</asp:label>
    <asp:Label id="lblName" style="Z-INDEX: 102; LEFT: 24px; POSITION:
    absolute; TOP: 56px" runat="server"></asp:Label></form>
    </body>
    </HTML>
     
    Marcelo, Jan 22, 2004
    #1
    1. Advertising

  2. Marcelo

    Cor Guest

    Cor, Jan 22, 2004
    #2
    1. Advertising

  3. Have you tried to set the value of AutoEventWireup from "false" to
    "true".

    Frank

    On Thu, 22 Jan 2004 00:59:49 -0500, "Marcelo" <>
    wrote:

    >Hi guys, I'm using the following code to send values from one page to
    >another, but seems to me, that the event Page_Load in the receiving page
    >never fires.
    >Why?
    >
    >This is the code:
    >
    >Thanks
    >
    >-*-*-*-*-*-*
    >
    >PAGE SENDING THE INFORMATION
    >
    >
    ><%@ Page Language="vb" AutoEventWireup="false" Codebehind="PageSend.aspx.vb"
    >Inherits="Testing.WebForm1" ClassName="classPageSend"%>
    ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    ><HTML>
    > <HEAD>
    > <title>WebForm1</title>
    > <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    > <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
    > <meta content="JavaScript" name="vs_defaultClientScript">
    > <meta content="http://schemas.microsoft.com/intellisense/ie5"
    >name="vs_targetSchema">
    > <!-- This is the script containig the logic to send -->
    > <!-- variable information from one page to another -->
    > <!-- THis is declared between the <HEAD> tag -->
    > <script language="vb" runat="server">
    >
    > Public ReadOnly Property FirstName() as String
    > Get
    > Return txtFirstName.Text
    > End Get
    > End Property
    >
    > Public ReadOnly Property LastName() as String
    > Get
    > Return txtLastName.Text
    > End Get
    > End Property
    >
    > Sub ButtonClicked(sender As Object, e As EventArgs )
    > Server.Transfer("PageReceive.aspx")
    > End Sub
    >
    > </script>
    > </HEAD>
    > <body MS_POSITIONING="GridLayout">
    > <form id="Form1" method="post" runat="server">
    > <asp:textbox id="txtFirstName" style="Z-INDEX: 101; LEFT: 72px; POSITION:
    >absolute; TOP: 72px"
    > runat="server"></asp:textbox><asp:textbox id="txtLastName"
    >style="Z-INDEX: 102; LEFT: 72px; POSITION: absolute; TOP: 104px"
    > runat="server"></asp:textbox><asp:button id="btnSend" style="Z-INDEX:
    >103; LEFT: 72px; POSITION: absolute; TOP: 144px" onclick="ButtonClicked"
    > runat="server" Text="Send"></asp:button></form>
    > </body>
    ></HTML>
    >
    >
    >
    >PAGE RECEIVING THE INFORMATION
    >
    ><%@ Page Language="vb" AutoEventWireup="false"
    >Codebehind="PageReceive.aspx.vb" Inherits="Testing.PageReceive" %>
    ><%@ Reference Page="PageSend.aspx"%>
    >
    ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    ><HTML>
    > <HEAD>
    > <title>PageReceive</title>
    > <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    > <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
    > <meta content="JavaScript" name="vs_defaultClientScript">
    > <meta content="http://schemas.microsoft.com/intellisense/ie5"
    >name="vs_targetSchema">
    >
    > <script language="VB" runat="server">
    >
    > Protected classPage as classPageSend
    >
    > Sub Page_Load()
    >
    > Response.Write("Say this")
    >
    > If Not IsPostBack then
    > classPage = CType(Context.Handler, classPageSend)
    > lblName.Text = "aaaa" 'classPage.FirstName
    > Response.Write("Say that")
    > End if
    >
    > End Sub
    >
    > </script>
    > </HEAD>
    > <body MS_POSITIONING="GridLayout">
    > <form id="Form1" method="post" runat="server">
    > <asp:label id="Label1" style="Z-INDEX: 101; LEFT: 24px; POSITION:
    >absolute; TOP: 40px" runat="server">Shows the Values</asp:label>
    > <asp:Label id="lblName" style="Z-INDEX: 102; LEFT: 24px; POSITION:
    >absolute; TOP: 56px" runat="server"></asp:Label></form>
    > </body>
    ></HTML>
    >
     
    Frank Grassens, Jan 22, 2004
    #3
    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. Replies:
    2
    Views:
    12,197
    Hal Rosser
    Feb 24, 2006
  2. loveNUNO
    Replies:
    2
    Views:
    964
    loveNUNO
    Nov 20, 2003
  3. Mark
    Replies:
    3
    Views:
    377
  4. Replies:
    1
    Views:
    593
    John Saunders
    Sep 29, 2008
  5. Robert Cohen
    Replies:
    3
    Views:
    301
    Andrew Durstewitz
    Jul 15, 2003
Loading...

Share This Page