Sunday, June 3, 2012

asp.net page clear Textboxes

this function clear All Form Textboxes

    Public Function EmptyTextBoxes(ByVal parent As Control)
        For Each C As Control In parent.Controls
            If TypeOf (C) Is TextBox Then
                CType(C, TextBox).Text = ""
            End If
            If C.HasControls Then
                EmptyTextBoxes(C)
            End If
        Next
    End Function 
 
Calling the function may be in page load or any event need to reset your form on its action 
Calling 
  EmptyTextBoxes(Me
 
 

No comments:

Post a Comment