I have multiple TextBoxes set on enabled = false. If user clicks on Button (btnEdit) all the textboxes should get enabled = true.
My Code:
protected void Read(Control control)
{
foreach (Control c in control.Controls)
{
if (c is TextBox && c.ID.StartsWith("txt"))
((TextBox)c).Enabled = true;
}
}
protected void btnEdit_Click(object sender, EventArgs e)
{
Read(pnlDialog);
}
pnlDialog is a Panel with all the TextBoxs.