private void EnableForm(bool isReadOnly)
{
bool isEndble = !isReadOnly;
Control ctl = txtProposer.Parent;
foreach(Control sonctl in ctl.Controls)
{
if (sonctl is TextBox)
{
((TextBox)sonctl).Attributes["readOnly"] = isReadOnly.ToString();
}
if (sonctl is HtmlInputText)
{
((HtmlInputText)sonctl).Attributes["readOnly"] = isReadOnly.ToString();
}
if (sonctl is RadioButtonList)
{
((RadioButtonList)sonctl).Enabled = isEndble;
}
if (sonctl is DropDownList)
{
((DropDownList)sonctl).Enabled = isEndble;
}
}
}
{
bool isEndble = !isReadOnly;
Control ctl = txtProposer.Parent;
foreach(Control sonctl in ctl.Controls)
{
if (sonctl is TextBox)
{
((TextBox)sonctl).Attributes["readOnly"] = isReadOnly.ToString();
}
if (sonctl is HtmlInputText)
{
((HtmlInputText)sonctl).Attributes["readOnly"] = isReadOnly.ToString();
}
if (sonctl is RadioButtonList)
{
((RadioButtonList)sonctl).Enabled = isEndble;
}
if (sonctl is DropDownList)
{
((DropDownList)sonctl).Enabled = isEndble;
}
}
}