I am trying to iterate over all controls in a panel components collection to retrieve value from nested TextBox components. the code below produces an error.
TextBox' is a 'type' but is used like a 'variable'. What is the best way to do this?
public void ListControlCollection()
{
foreach (Control ctrl in assesmentPanel.Controls)
{
if (ctrl.GetType().Equals(TextBox))
{
question_txt.Text = ctrl.Text;
}
}
}
TextBox' is a 'type' but is used like a 'variable'. What is the best way to do this?
public void ListControlCollection()
{
foreach (Control ctrl in assesmentPanel.Controls)
{
if (ctrl.GetType().Equals(TextBox))
{
question_txt.Text = ctrl.Text;
}
}
}