遍历页面控件并赋值
时间:2010-09-29 来源:liguottkl
//遍历页面上所有TextBox控件,并清空
private void InitialControl(ControlCollection objControlCollection)
{
foreach (System.Web.UI.Control objControl in objControlCollection)
{
if (objControl.HasControls())
{
InitialControl(objControl.Controls);
}
else
{
if (objControl is System.Web.UI.WebControls.TextBox)
{
((System.Web.UI.WebControls.TextBox)objControl).Text = String.Empty;
}
}
}
}
相关阅读 更多 +