title: What is an efficient and maintainable method for creating a wizard-style navigation system with complex rules in an ASP.NET application?
body: <p>I'm working on team, updating a commercial web app in C#. We're using Telerik's RadControls. The application guides the user through a set of tasks in a wizard-like fashion, but also allows the user to jump back  to previous steps and make modifications. Additionally, some steps have complex validation methods. For example, once you complete a task on step 5, steps 7, 8, and 9 become available. Also, if you change any settings on step 2, everything after that point has to be re-done, so all steps after step 3 must be disabled.</p>
  
  <ul>
  <li>There is a navigation bar on the left side of the screen (a Telerik
  RadPanel) that lists all of the steps in sequential order. Depending
  on where you are at in the process, some steps are available to the
  user, and some are disabled.</li>
  <li>There is a drop-down box at the top of the page (a Telerik
  SplitButton on a RadToolBar) that also contains all of the steps</li>
  <li>There are forward and backward buttons that let you move to the next
  or previous step in the process.</li>
  </ul>
  
  <p>Each of the "steps" have their own Page, so clicking on a link to "Step 1" will take you to step1.aspx</p>
  
  <p>The navigation code is strewn all over the master page. There are methods that handle the step-enabling logic that are basically massive switch statements on the navigation panel's selected index. I want to re-write all of this functionality and put it into one "NavigationManager" class that has a reference to all of the necessary controls (although I'm open to suggestions on that). I'm looking for a solution that will:</p>
  
  <ul>
  <li>Know where the user is in the process, and where the user is allowed to go so that it can enable and disable navigation items on every page load. Each steps should have a kind of validation process that enables it to decide where to send the user.</li>
  <li>Know how to enable and disable navigation items for each control. How do I link this up? The button indexes are unpredictably different for each navigation control.</li>
  <li>Know how the steps are related so that the user can click the "next" button and be taken to the next sequential step.</li>
  <li>Be maintainable - The current system is so convoluted that fixing one bug causes others.</li>
  <li>Be efficient - It shouldn't take much time to process on each page load</li>
  </ul>
  
  <p>I suppose that what I'm really having difficulty with is how to define all of these steps somewhere <em>once</em>, so that the system can make use of them. I thought about defining all of the steps in an <code>enum</code>, but I'm foreseeing lot's of switch statements for enabling the step buttons on the navigation controls.</p>
  
  <p>I've Googled every related keyword I could think of, and I can't find anything helpful. I <em>know</em> that this not a unique issue. I see lots of examples of web apps with similar navigation systems, such as TurboTax.</p>
  
  <p>So, my questions are:</p>
  
  <ul>
  <li>How do I define all of my steps in one spot so that the entire program knows how to deal with them?</li>
  <li>How do I use those definitions to determine which steps the user can access, and then enable the appropriate navigation items?</li>
  </ul>