Monday, January 2, 2012

How to Clear all Text Boxes on button Click in web Application

 For Each c As Control In fr
            If c.ToString.Equals("System.Web.UI.WebControls.TextBox") Then
                CType(c, TextBox).Text = ""
            End If

            If c.ToString.Equals("System.Web.UI.WebControls.DropDownList") Then
                CType(c, DropDownList).ClearSelection()
            End If
        Next

No comments:

Post a Comment