Geeks With Blogs
Geekette's Blogette Trying to keep up with technology

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 on Friday, March 23, 2007 2:22 PM | Back to top


Comments on this post: ASP.NET Wizard Control

# re: ASP.NET Wizard Control
Requesting Gravatar...
what is ASP.NET Wizard Control?
Left by dssd on Feb 03, 2009 1:36 AM

# re: ASP.NET Wizard Control
Requesting Gravatar...
This is best one article so far I have read online. I would like to appreciate you for making it very simple and easy. I have found another nice post related to this post over the internet which also explained very well. For more details you may check it by visiting this url.......

http://mindstick.com/Articles/d2707ea4-3836-4390-ab0b-670e12e6b2dc/?Wizard%20Control%20in%20ASP.Net

Thanks
Left by JayPrakash Sharma on Jan 10, 2012 4:03 AM

Your comment:
 (will show your gravatar)


Copyright © Robin Edwards | Powered by: GeeksWithBlogs.net