Thursday, February 14, 2008

.NET Wizard Control Header Template

Ok, this seems like it would be common knowledge, but I couldn't find a good way to reference controls in a wizards header template. Now, if you look at the MSDN Help it says use the Wizard.FindControl method, but this doesn't work. Looking for it in the Wizard.Controls also doesn't work. The first few implementations that I found on the web suggested using the ClientID of the control and the Page.FindControl method, but this is a bit hacky to me.

After some searching for the answer, 3 pages deep in google found me this gem:
Wizard.FindControl("HeaderContainer").FindControl("ControlName")

Where did this HeaderContainer come from? I don't know, I am just glad that it works.

No comments: