Clearing the fields in the form in vb.net
How to clear the test fields , to perform very faster way. I am using this clear() method as follows
Me.ocmpnyto.Value = ""
Me.ocontactto.Value = ""
Me.ophoneto.Value = ""
Me.ofaxto.Value = ""
is there any alternative .....
Thanks and Regards,
Edited by: Yughandar on Apr 12, 2010 5:47 PM
What u have tried is fine, but u could also try the following..
Dim frm As Control = Me.FindControl("Form1") Dim ctl As Control For Each ctl In frm.Controls Dim tb As TextBox If TypeOf ctl Is TextBox Then tb = CType(ctl, TextBox) tb.Text = String.Empty End If Next
Hope it helps,