标签:
foreach(Control ctrl in Page.Controls) { foreach(Control childc in ctrl.Controls) { switch(childc.GetType().ToString()) { case "System.Web.UI.WebControls.TextBox" : TextBox txt = (TextBox)childc; txt.ReadOnly = true; break; case "System.Web.UI.WebControls.Label" : Label lbl = (Label) childc; break; case "System.Web.UI.WebControls.DropDownList" : DropDownList ddl = (DropDownList) childc; break; } } }
ASP.NET、WinForm - 判断整个页面文本框是否为空
标签:
原文地址:http://www.cnblogs.com/KTblog/p/4695089.html