+1  A: 

this may not be exactly what you're looking for, but what if you use jQuery to hide and show DIV tags. Then the user will get the experience of a wizard while all content is all inside a single view. Then it can all be handled nicely with a single controller

Another option might be to create a separate view "step" for each wizard step

http://example.com/page/step/1

Then you can create a Class Object that contains ALL fields, and add to it as you navigate the wizard by adding to a Session Object

(Custom.Class.Obj)Session["myWizard"]

This way it allows you to build standard Views and load what information you have from the Session Object.

rockinthesixstring
+2  A: 

You should implement a strong typed view or control. In this type define a property indicating wich step you are and other logic. EX:

public class WizardView
{
     public List<string> Steps { get; set; }
     public int CurrentStepNumber {get;set;}

     public bool ShowNextButton
     {
         get
         {
             return CurrentStepNumber < this.Steps.Count-1;
         }
     }  

     public bool ShowPreviousButton
     {
         get
         {
             return CurrentStepNumber > 0;
         }
     }  
}

And your control:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<WizardView>" %>


    <table width="100%">
       <tr>    

         <% 
            int index=0;
            foreach(string step in Model.Steps)
            {
            %>   
                <td class='<%=Model.CurrentStep==index?"current":"notcurrent" %> style="width:18%;">
                       <%= step %>
               </td>
           <%
                index++;  
             } %>
        </tr>
</table>

In your controller

public ActionResult MyAction(int step)
{
    return View (new WizardControl {
       Steps = Myrepository.getSteps();
       CurrentStep = step
     });
}

}

Gregoire
This is a really great solution. Thank you! Now I just need to figure out how to know whether the previous button or next button was clicked.
Jason
@baijajusav - if Gregoire's solution works for you, why not upvote it? <rant>It seems to becoming a norm where answers are no longer being accepted and voted on. Makes it really tough when one does find a question but the answers are neither accepted or upvoted</rant>
Ahmad
@Ahmad. That's a very good point. I've upvoted his solution, but have not accepted it because the heart of my issue is detecting whether the Previous or Next button was clicked. The buttons themselves just submit the form. I figure I will have to add logic in the controller to handle redirecting the action based on which of the buttons were clicked.
Jason
Just to note, this answer doesn't solve my issue 100%, but, like I said earlier, it did get me thinking in a different way so I could arrive at the solution I did.
Jason
A: 

Here is another way to go - expanding on the WizardView approach. What you describe is a state engine - something aware of states, transitions and the behaviors and triggers associated with each.

If you check out an implementation like stateless (http://code.google.com/p/stateless/), you'll see that you can desribe the states (steps in the wizard view approach) and the triggers associated with each. Based on your description, you could either capture this information in your state engine wire up - or perhaps ignore it altogether by the fact that all transitions are discretely handled by the engine.

To go a step further, your view wire up can now become quite generic. No need for the view to be aware of the state fulness of the operations, just relying on the view model itself.

S. Hebert