作者bbgbbg (小叶)
看板Visual_Basic
标题[ASP ] 如何得到另一个form上的物件状态
时间Wed May 16 22:05:47 2007
小弟希望按下WebForm2的按钮後 判断WebForm1的RadioButton状态
程式如下
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
system.EventArgs) Handles Button1.Click
Dim w1 As WebForm1 = New WebForm1
If w1.RadioButton1.Checked = True Then
Label1.Text = "web3"
ElseIf w1.RadioButton2.Checked = True Then
Label1.Text = "web4"
ElseIf w1.RadioButton3.Checked = True Then
Label1.Text = "web5"
End If
End Sub
在WebForm1里已用public宣告Radiobutton1物件
但执行後 会出现 "并未将物件参考设定为物件的执行个体 " 的讯息
请问各位大大,这个问题要如何解决呢?
ps:另外请教,要怎麽在按钮事件写入网页连结?
因为不像hyperlink物件有NavigateUrl和Target可以使用
在此先谢过 各位大大了!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.224.102.36
1F:推 kylechen:原po是正妹 05/16 23:35
2F:推 fumizuki:请在 WebForm1 使用 Input(Hidden) 储存WebForm1的状态 05/17 12:47
3F:推 fumizuki:WebForm1 中执行 Server.Transfer("WebForm2.aspx") 05/17 12:49
4F:→ fumizuki:会将状态传给WebForm2,Request("input的id")读取状态 05/17 12:49
5F:→ fumizuki:1F是走错版吗@@ 05/17 12:50