网站开发中常见的安全漏洞,济南网站设计哪家好,母婴网站的功能设计,百度推广怎么赚钱该方法#xff1a;主要用于对前台页面的不同类型#xff08;TextBox、DropDownList、等#xff09;或全部控件进行批量操作#xff0c;用于批量修改其属性#xff08;如#xff0c;Text、Enable#xff09;。 private void GetControlListT(ControlCollection c…该方法主要用于对前台页面的不同类型TextBox、DropDownList、等或全部控件进行批量操作用于批量修改其属性如Text、Enable。 private void GetControlListT(ControlCollection controlCollection, ListT resultCollection)where T : Control{foreach (Control control in controlCollection){ if (control is T) resultCollection.Add((T)control);if (control.HasControls())GetControlList(control.Controls, resultCollection);}} 调用 ✔ 主要是用来禁用 Enable 属性将其变为不可用。 //隐藏页面关于资产分类的选择控件以及保存和提交按钮。
ListTextBox allTextBoxs new ListTextBox(); //对Textbox进行禁用GetControlListTextBox(Page.Controls, allTextBoxs);foreach (var childControl in allTextBoxs){childControl.Enabled false; //call for all controls of the page}ListDropDownList allDDLs new ListDropDownList(); //对dropdownlist进行禁用GetControlListDropDownList(Page.Controls, allDDLs);foreach (var childControl in allDDLs){childControl.Enabled false; //call for all controls of the page} 转载于:https://www.cnblogs.com/JesseP/p/10681141.html