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; } |