« [ASP.NET] HttpContextで他のページへ送信 | メイン | [ASP.NET] ViewState と Session »
2005年10月06日
[ASP.NET] Server.Transfer(サーバーコントロール)で他のページへ送信
'--- 送信側: htmlに <%@ ClassName="WebForm1Class" %> を追加する。Private Sub btnTransfer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTransfer.Click
Server.Transfer("Test.aspx")
End SubPublic ReadOnly Property Name() As String
Get
Return txtName.Text
End Get
End PropertyPublic ReadOnly Property Address() As String
Get
Return txtAddress.Text
End Get
End Property
'--- 受信側: htmlに <%@ Reference Page="WebForm1.aspx" %> を追加する。 Dim FP As sample.ViewState If Not IsPostBack Then FP = CType(Context.Handler, sample.ViewState) End If lblName3.Text = FP.Name lblAddress3.Text = FP.Address
2005 / 10 / 06