怎么遍历页面上的Input控件

    Dim j As Integer
        
For j = 0 To (Me.Controls.Count) - 1
            
If Me.Controls(j).GetType().ToString() = "System.Web.UI.HtmlControls.HtmlForm" Then
                
Dim i As Integer
                
For i = 0 To (Me.Controls(j).Controls.Count) - 1

                    
If TypeOf Me.Controls(j).Controls(i) Is HtmlInputText Then
                        
Dim tb As HtmlInputText = CType(Me.Controls(j).Controls(i), HtmlInputText)
                        tb.Value 
= "888"
                    
End If


                
Next i
            
End If
        
Next j
原文地址:https://www.cnblogs.com/LCX/p/677255.html