I'm writing a survey web application and I have a wizard control with a few steps added from the designer view. The user selects the name of the survey they would like to complete in the first step, then the user hits the next button and I read the survey details from the database. I have created custom user controls for each type of question which I programatically add to step 2 of the wizard control after reading each survey question from the database.
This works fine, and the survey displays as expected. However, when the user fills in the answers to the questions and hits next, I don't have access to the answers typed into the text boxes. It seems as though all the custom controls I have added to step 2 have been deleted since I get a null reference exception when trying to access the controls. I even printed out the number of controls in step 2 after the next button was hit (it should be 11) but instead printed out that there were no controls in the step.
Am I missing something? Is there a property I need to set to be able to access my dynamically added controls from a step?