Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.
ASP.NET: Clear all TextBox values
From Wiki
Summary: An example of a recursive function to clear all TextBox values on a page
- Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
- EmptyTextBoxValues(Me)
- End Sub
- Private Sub EmptyTextBoxValues(ByVal parent As Control)
- For Each c As Control In parent.Controls
- If (c.Controls.Count > 0) Then
- EmptyTextBoxValues(c)
- Else
- If TypeOf c Is TextBox Then
- CType(c, TextBox).Text = ""
- End If
- End If
- Next
- End Sub
This Hack is part of the ASP.NET Hacks collection



LTD Social Sitings
Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.