For Each In Web Form

There is a Web Form and its in have TextBoxes and TextBoxes stars with txt

I want to these textboxes with For Each clear and so my code


Sub Clear()
For Each Ctrl As Control In Page.Controls
If TypeOf (Ctrl) Is TextBox Then
If Ctrl.ID.StartsWith("txt") Then
CType(Ctrl, TextBox).Text = ""
End If
End If
Next
End Sub



Thanks For Help
[840 byte] By [gokce] at [2007-12-24]
# 1

Do you have a question?

ScottWisniewski-MSFT at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2
This Code Doesn't work.
Thank You
gokce at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3
webform questions are referred to www.asp.net for better expertise.
ReneeC at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...