遍历页面中的Textbox

遍历页面中的Textbox


foreach (System.Web.UI.Control controls in Page.Form.Controls )
            {
                if (controls is System.Web.UI.WebControls.TextBox)
                {
                    TextBox tb = (TextBox)controls;
                    tb.Text = string.Empty;
                }
            }

你可能感兴趣的:(遍历页面中的Textbox)