0

I'm creating a multi-step form in MVC3. Each step is a View, and I have a form on each one, with a hidden field to store the serialised model. The below method is used to retrieve the model from the hidden field between each step.

protected override void OnActionExecuting(ActionExecutingContext filterContext)
    {
        _model = (SerializationUtils.Deserialize(Request.Form["model"]) ?? TempData["model"] ?? new Model()) as Model;
        TryUpdateModel(_model);
    }

My problem is that on one of the forms, I want to have a dialog, which allows the user to select items from a list. When the user closes the dialog, the values selected should populate stuff on the form. The dialog does not have the hidden field. So when I submit the dialog, the above code isn't executed as there is no field called 'model', meaning if I refresh the main form, the panel with the dialog results doesnt populate as the values aren't written onto the model.

Does anyone know how I can achieve this, using any approach?

arrkaye
  • 656
  • 8
  • 22
  • I don't understand what you're doing, but instead of a multi-step form you may want to do this client side like in this answer. http://stackoverflow.com/questions/2074707/creating-multi-step-forms/2074762#2074762 – Ryan Aug 02 '11 at 22:54
  • Are you using the jQuery UI dialog by any chance? – eth0 Sep 20 '11 at 08:15

0 Answers0