
/**//// <summary>
/// 画面各項目有効⇔無効相互に変換する処理
/// </summary>
/// <param name="page">Web フォーム ページ</param>
/// <param name="blnEditMode">編集可否フラグ true:編集可</param>
public static void ChangeEditMode(Page page, bool blnEditMode)
{
foreach (Control c in page.Form.Controls)
{
if (c is TextBox)
{
((TextBox)c).Enabled = blnEditMode;
}
else if (c is Button)
{
((Button)c).Enabled = blnEditMode;
}
else if (c is DropDownList)
{
((DropDownList)c).Enabled = blnEditMode;
}
else if (c is ListBox)
{
((ListBox)c).Enabled = blnEditMode;
}
else if (c is CheckBox)
{
((CheckBox)c).Enabled = blnEditMode;
}
else if (c is CheckBoxList)
{
((CheckBoxList)c).Enabled = blnEditMode;
}
else if (c is RadioButton)
{
((RadioButton)c).Enabled = blnEditMode;
}
else if (c is RadioButtonList)
{
((RadioButtonList)c).Enabled = blnEditMode;
}
else if (c is HyperLink)
{
((HyperLink)c).Enabled = blnEditMode;
}
}
}
浙公网安备 33010602011771号