[ASP ] 如何得到另一個form上的物件狀態
小弟希望按下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
推
05/16 23:35, , 1F
05/16 23:35, 1F
推
05/17 12:47, , 2F
05/17 12:47, 2F
推
05/17 12:49, , 3F
05/17 12:49, 3F
→
05/17 12:49, , 4F
05/17 12:49, 4F
→
05/17 12:50, , 5F
05/17 12:50, 5F