Page1.aspx
Public Class Page1
Public WithEvents TextBox1 as System.Web.UI.WebControls.TextBox
' din programkod
End Class
Page2.aspx
Dim sourcePage As Page1
SourcePage = CType (Context.Handler, System.Web.UI.Page)
Response.Write(sourcePage.TextBox1.Text)
' En annan variant att göra detta på är
Page1.aspx
Public Class Page1
Protected WithEvents TextBox1 as System.Web.UI.WebControls.TextBox
' din programkod
End Class
Page2.aspx
Dim sourcePage As Page1
Dim sourceControl as TextBox
sourcePage = CType(Context.Handler, System.Web.UI.Page)
SourceControl = CType
(sourcePage.FindControl("TextBox1"),
System.Web.UI.Control)
Response.Write (SourceControl.Text)