No matter what I've tried, (and I've tried all the things mentioned in every article I can find!), I cannot get the FindControl to work.
<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0"<asp:Label ID="lblNote" runat="server" Text="Wizard Step Title Goes here" ></asp:Label>
</HeaderTemplate> protected void Wizard1_ActiveStepChanged(object sender, EventArgs e)}
I moved the label to one of the steps, and the same FindControl code could find the label.
I've tried Wizard1.FindControl, WizardStep1.FindControl, Wizard1.Page.FindControl, and half-a-dozen other ways.
Any ideas?
Found this routine at http://www.asptoday.com/Content.aspx?id=2359 that does the trick very nicely:
private
Control FindControl(Control parent, string id){
if (parent.ID == id){
return parent; } foreach (Control child in parent.Controls){
Control recurse = FindControl(child, id); if (recurse != null){
return recurse; }}
return null;}
Copyright (c) Marimer LLC