Visual Basic.Net
Pagina 1 (aspx)
codice:
.......
<head runat="server">
<title>cross</title>
</head>
<body>
<form id="form1" runat="server">
Cross Page posting con PostbackUrl:
<asp:TextBox ID="tb" runat="server"></asp:TextBox>
<asp:button ID="btCross" PostBackUrl="due.aspx" Text="Pagina seguente" runat="server" />
</form>
</body>
</html>
Pagina 2 (code-behind)
codice:
Public Class due
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
If Not Page.PreviousPage Is Nothing Then
Dim Box As TextBox = CType(PreviousPage.FindControl("tb"), TextBox)
If Not Box Is Nothing Then
Response.Write("Il testo della text nella pagina precedente è: " & Box.Text)
End If
End If
End If
End Sub
End Class
funziona ancora alla grande.