tags:

views:

172

answers:

1

I am trying to use the FindControls method to find the Next Button in my Wizard so I can set it as the default button, but I can't seem to find it.

Here is the control name from View Source in IE:

ctl00_MainContentPlaceHolder_ApplicationWizard_StartNavigationTemplateContainerID_StartNextButton

This is the code block I'm using to set the default button:

Page.Form.DefaultButton = ApplicationWizard.FindControl("StartNavigationTemplateContainerID").FindControl("StartNextButton").UniqueID;

However, it can't find the StartNavigationTemplateContainerID control. What am I doing wrong here?

A: 

I was having trouble finding the next button on my wizard, but I found it this way:

Button btnNext = (Button)MyWizard.FindControl("StartNavigationTemplateContainerID$StartNextButton");

I found this blog helpful.

John Fischer