最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp.net 遍历指定的控件类型 设置为只读
时间:2022-06-25 03:48:22 编辑:袖梨 来源:一聚教程网
代码如下 | 复制代码 |
protected void TurnControlsReadOnly() { foreach (Control obj in form1.Controls) { if (obj is TextBox) { //obj.Attributes.Add("readonly", "true"); ((TextBox)obj).ReadOnly = true; } } foreach (Control obja in form1.Controls) { if (obja is DropDownList) { ((DropDownList)obja).Enabled = false; } } foreach (Control objb in form1.Controls) { if (objb is Button) { ((Button)objb).Visible = false; ((Button)objb).Enabled = false;
} } foreach (Control obja in form1.Controls) { if (obja is RadioButtonList) { ((RadioButtonList)obja).Enabled = false; } }
dropSort.Enabled = false; //btnUPloadIma.Visible = false; ddlCategory.Enabled = true; btnSaveCategory.Visible = true; btnSaveCategory.Enabled = true; txtOtherCategory.ReadOnly = false; txtSortOther.ReadOnly = true;
for (int i = 0; i < dlstProductImage.Items.Count; i++) { dlstProductImage.Items[i].FindControl("lbtnDelete").Visible = false; } fldBuyInfoImage.Visible = false; } |
相关文章
- 沙石镇时光肥料怎么合成-详细方法介绍 05-05
- 新版cex交易所app 05-05
- cex数字货币交易所 05-05
- pi币挖矿app2024最新版本 05-05
- cex交易平台app下载2024最新版 05-05
- 火必网app官网正版 05-05