Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8327145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:00:26+00:00 2026-06-09T01:00:26+00:00

I am trying to implement wizard functionality in my forms using .NET MVC. I

  • 0

I am trying to implement wizard functionality in my forms using .NET MVC. I came across a method of achieving this by Darin Dimitrov. Basically he has a wizard view model, which contains a list of ISteps. Each step has it’s own properties and validation.

He serializes the wizard on the view (as a kind of view state) and then posts that and the current step up to the controller. So each step of the wizard, you validate only that step. If it’s successful, increment the current step and repeat.

For the most part – this works quite nicely. However I have come across a problem when validating the individual steps, as some of my steps are dependant on previously submitted values for their validation.

So, I need to add a way to allow the individual wizard steps to access previous steps.

The way I decided to go about this, is to include the wizard on the step.

public interface IWizardStep
{
    WizardViewModel Wizard { get; set; }
}

And then in the model binder Darin provided, add an override for BindModel

public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
{
    var step = (IStepViewModel)base.BindModel(controllerContext, bindingContext);
    step.Wizard = (WizardViewModel)serializer.Deserialize(controllerContext.HttpContext.Request.Form["wizard"], SerializationMode.Signed);
    return step;
}

This seems to work, however in my controller I have a ModelStateError:

The parameter conversion from type ‘System.String’ to type
‘Wizard’ failed because no type converter can
convert between these types.

I assume this is due to the fact that the model binder is trying to bind recursively?

Does anyone know how I could solve this? Or – am I even approaching this correctly? Is there a better way to do this?

I have put all the above is a basic sample project to illustrate the problem I am having.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:00:28+00:00Added an answer on June 9, 2026 at 1:00 am

    So I never got to the bottom of why this didn’t work but decided to save myself the headache and save the wizard in session, rather than serializing and posting it back every step. That way, I can easily get the wizard in the Validate(ValidationContext) method of the view models. Seems to work well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying implement a bracket in my program (using C#/.NET MVC) and I am
I am trying to implement a wizard and I am using the CardLayout .
Trying to implement LoaderManager + CursorLoader. In onFinish method adapter should swap its cursor
Trying to implement a search similar to here .This searches properties based on city,locality,property
I am trying to creating a small wizard using jsf1.2 sun RI +richfaces. The
Trying to implement an autocomplete based on this It looks like it's very straight
I'm pulling my hair out on this one. I am trying to implement a
Trying to implement search with Sunspot Gem wich is using Solr.Fulltext search works fine
I'm trying implement a way to recursively template using jsRender. The issue is, my
I have this weird kind of error. I am trying implement basic Euclidean algorithm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.