I'm looping through the Controls collection of an asp:Panel, and I am not sure how to set Properties specific to some controls...
For example the Panel might contain a DropDownList, and I would like to be able to set and get the SelectedValue of this. Or it might contain a TextBox, and I would like to set and get the Text property.
I'm using this code to traverse:
foreach (Control control in panel.Controls)
{
// ...
}
And since I get just a Base Control from this, it appears not to be able to get/set any of these properties as they are not defined for the Base Control.
So, what to do?
Thanks