Problem sending values from one page to another (pepehammer)

M

Marcelo

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>
 
F

Frank Grassens

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

Frank
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top