How to get reference to a control (e.g. DropDownList) in the header of a Wizard Control in ASP.NET 2.0.
The control can't be referenced directly cause it is in a template. So you have to find the header of the wizard control and look in there.
This is the code to get to a control in the header.
DirectCast(Wizard1.Controls.Item(0).Controls.Item(0).Controls.Item(1).Controls.Item(0).Controls.Item(0).Controls.Item(0).Controls.FindControl(“MyDropDownLists”), DropDownList)
Not to hard, but certainly not elegant either.
I changed the Wizard Control a couple of times to see if the code would continue to work. And it does. But you don't hear me saying that no matter what change the code will work.
Here is an interesting article about finding controls in controls like Repearer, Datagrid, ...
10:44:49 AM
|