Dim ObjtextBox As New Textbox
For Each MainControl As Control In Page.Controls For Each objControl As Control In MainControl.Controls If objControl.GetType.ToString = "System.Web.UI.WebControls.TextBox" Then objTextBox = objControl End If NextNext
Note: 1. Use a 2-layer loop because TextBox and other controls are subcipes for a control in Page.Controls.
2. Use the method of traversing TextBox, which can easily fill in the corresponding data in the database to the corresponding TextBox.