How to create an MVC wizard similar in functionality to Webforms Wizards?

I would like to create a wizard in ASP.NET MVC similar to the wizard management function found in ASP.NET web formats.

What is the best way to do this?

+3
source share
5 answers

With ASP.NET MVC, I would suggest using javascript / jquery to create a wizard on a web page; sort of

<script type="text/javascript">
    $().ready(InitializeWizard);
    function InitializeWizard() {
        $(".step").hide();
        $("#step1").show();
    }
    function Step1OK() {
        $("#step1").hide();
        $("#step2").show();
    }
    function Step2OK() {
        $("#step2").hide();
        $("#stepComplete").show();
    }
</script>

<div id="step1" class="step">
    Step 1
    <input type="button" onclick="Step1OK();" value="OK" />
</div>
<div id="step2" class="step">
    Step 2
    <input type="button" onclick="Step2OK();" value="OK" />
</div>
<div id="stepComplete" class="step">
    Complete
</div>

NB! Remember that jquery, for example, is loading at the top of the document. by link to google link:

<script src="http://www.google.com/jsapi"></script>
<script>
    google.load("jquery", "1.3.2");
</script>
+6
source

ASP.NET MVC. ASP.NET MVC -, webformy MVC. jQuery partials (Partial Views), , .

+2

ASP.NET MVC , . - , - , cookie, querystring (blah? Page = 2), , , .

+2

.

jQuery .

+2

MVCWizard.Wizard, NuGet. WizardController . AutoWizardController, . .

+1
source

Source: https://habr.com/ru/post/1706806/