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 7640635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:43:11+00:00 2026-05-31T08:43:11+00:00

I want to make something like a questionnaire with different sections. Therefore, I created

  • 0

I want to make something like a questionnaire with different sections.
Therefore, I created an Index.cshtml, which includes the according partial View (depending on the number my step-integer has). Something like

@using (Html.BeginForm())
{
        @Html.Partial("Step" + Model.Step, Model)
        <p>
            @if (Model.Step > 1)
            {
                <button name="button" value="Zurück" />
            }
            <input type="submit" value="Weiter" />
        </p>
}

As you may already noticed, It will look for something like “Step1.cshtml” and so on, where the according input mask is placed, for example

@model CVGen.Models.InputModel
<div class="editor-field">
    @Html.TextBoxFor(model => model.Anrede)
    @Html.ValidationMessageFor(model => model.Anrede)
</div>

My model contains the properties of the whole questionnaire, so of course I want to pass the whole model every time to the next step/view (and if I go back the model should be passed back too, so that the information is still there and the user can edit it).
But it just won’t work for me. My controller looks something like this:

public ActionResult Index()
{
    InputModel model = new InputModel();

    return View(model);
}

[HttpPost]
public ActionResult Index(InputModel model)
{
    model.Step++;
    return View(model);
}

Also my model.Step Property is always 0 (or 1, after 1 is added in the HttpPost), which is of course because my model won’t be passed a second time.

Any suggestions?

  • 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-05-31T08:43:12+00:00Added an answer on May 31, 2026 at 8:43 am

    might be worth looking over previous blog examples on this topic (as well as a few here on SO):

    • http://afana.me/post/create-wizard-in-aspnet-mvc-3.aspx
    • how to make a wizard with ASP.Net MVC
    • Multi step wizard form with MVC
    • multi-step registration process issues in asp.net mvc (splitted viewmodels, single model)
    • Asp.net mvc wizard – Need some guidance

    in a nutshell, I would do something like the following, irrespective as to whether jQuery/javascript is allowed or not:

    • Create a model that contains ALL fields required by the wizard.
    • Create a NEW controller (for the wizard steps)
    • Create a single Action per wizard page (again, all actions should use the same wizard model)
    • Create a SAVE action at the end of the process that saves everything to the database.

    Also, in your example above, you don’t include the ‘step’ on the view inside the form tags. THis will be required on postback. You should add something like:

    @Html.HiddenFor(model => model.Step)
    

    your milage may vary – good luck

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

Sidebar

Related Questions

Hello I want to make something like a meta language which gets parsed and
I want to make something like iGoogle in WordPress, in which I can drag
I want to make something like readability, which extracts only the article text from
I want to make something like this... :LoopBegin if ???? goto End some other
I have to make something like an accordion, but I want it to fade
say I want to make the first row of the excel ss something like
I want to make something like on your internet browser. It will have a
I want to make something like a horizontal line with a text in the
I want to make something like http://www.djangosnippets.org/accounts/register/ using django..the register form. I am new
i want something like this: http://www.someniceandreliableurl.com/username and catch the username. I want to make

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.