胖在一方

出得厅堂入得厨房的胖子

导航

利用Context.Handler在2个页面中传值

Posted on 2006-09-12 17:20  胖在一方  阅读(763)  评论(1)    收藏  举报
 1 1、WebForm1.aspx
 2 声明2个公共属性,读取对应的文本框的值
 3 Public ReadOnly Property Text1() As String
 4         Get
 5             Return TextBox1.Text
 6         End Get
 7     End Property
 8 
 9 
10     Public ReadOnly Property Text2() As String
11         Get
12             Return TextBox2.Text
13         End Get
14     End Property
15 
16 2、跳转到WebForm2页面
17  Server.Transfer("webform2.aspx")
18 
19 3、接受页面
20     Dim web As WebForm1
21     web = CType(context.Handler, WebForm1)
22     Me.TextBox1.Text = web.Text1
23     Me.TextBox2.Text = web.Text2
24