I have been working with the asp.net wizard control and have found it to work quite well. It's like having a workflow for some linked web pages. Each step has it's own "mini page". You can simply drag and drop controls from the toolbar onto the design area for the step. This includes the GridView and includes enabling edit within the Gridview control. Pretty slick.
I recently ran into a problem though. I have a wizard control with 4 steps. Each step's design area contains several controls. I tried to "remove" two of the steps using the Visual Studio UI smart tag . It appeared I was able to remove two steps, but when I clicked OK the .aspx page now rendered the wizard control with the following message:
Error Rendering Control - Wizard1
An unhandled exception has occured. The ActiveStepIndex must be less than the WizardSteps.Count and at least -1. For dynamically added steps, make sure they are added before or in a Page-PreInit event. Parameter name: value
If you click "undo" you will receive the following:
"Out of memory" (really nice, also note that if you remove steps and do not receive the error rendering, "undo" works just fine. In other words, "undo" works as long as you don't make a mistake!)
What this really means:
Before using the smart tag to edit the wizard control, you were currently displaying a step that you removed. You can correct the rendering error by setting the Wizard1.ActiveStepIndex property to a step that still exists. The best advice though: do not be displaying a step which you plan to remove when entering the wizard control smart tag. (That might sound like "duh", but I found I tended to look at the steps to be sure I knew which step I wanted to remove and inevitably wound up entering the smart tag with the step to be removed active.)
posted @ Friday, March 23, 2007 2:22 PM