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>

Re: Problem sending values from one page to another (pepehammer) by Cor

Cor
Thu Jan 22 02:24:50 CST 2004

Hi Marcelo,

Paul had yesterday almost the same problem, I did send him this

You have to save your values or in "session" variables, but things like this
beter in a "viewstate".

Have a look for that.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspnet/html/asp11222001.asp

If you do not find it, message again.
(But not direct)

I hope this helps?

Cor



Re: Problem sending values from one page to another (pepehammer) by Frank

Frank
Thu Jan 22 10:30:21 CST 2004

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

Frank

On Thu, 22 Jan 2004 00:59:49 -0500, "Marcelo" <pepehammer@hotmail.com>
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>
>