(1)方法, 要一個一個對欄位增加。
(2)方法, 是只要下ClearTexBox(), 就可以清空所有欄位的內容。
(1)
TextBox1.Text = ""
(2)
Private Sub ClearTextBox()
For Each control As System.Web.UI.Control In Me.Controls
For i As Integer = 0 To control.Controls.Count - 1
If TypeOf control.Controls(i) Is System.Web.UI.WebControls.TextBox Then
Dim tbx As System.Web.UI.WebControls.TextBox = DirectCast(control.Controls(i), System.Web.UI.WebControls.TextBox)
tbx.Text = ""
End If
Next
Next
End Sub
回目錄
回首頁
沒有留言 :
張貼留言