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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:17:30+00:00 2026-05-28T03:17:30+00:00

I currently have a 3 step wizard. Step 1: takes some details I need

  • 0

I currently have a 3 step wizard.

Step 1: takes some details I need and has a dropdown where you select the number of packages

Step 2:
depending on how many packages you selected this step shows you the required number of editors for packages

Step 3: confirm your order

I have been told I need to combine steps 1 & 2 but I am at a loss on how to do this with mvc and razor, because its simply a VIEW on your model…

What is the best way to do this?

would it be a case of submitting the page back to itself with an action dedicated specifying how many packages are required, or could this be done with ajax?

Thanks

  • 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-28T03:17:31+00:00Added an answer on May 28, 2026 at 3:17 am

    My approach would be as follows:

    Create a partial for the package row (PackageRow.cshtml)

    @model IEnumerable<PackageViewModel>
    <div class="editorRow">
    @using (Html.BeginCollectionItem("packages"))
    {
        @Html.TextBoxFor(x => x.WhateverYouNeed) 
    }
    </div>
    

    Load your package rows into the form via ajax upon the user selecting the number of rows

    @Html.ActionLink("Go!", "AddPackages", null, new { id = "addPackages" })
    
    <div id="editorRows"></div>
    
    <script type="text/javascript">
    $(document).ready(function () {
            $("#addPackages").click(function () {
                $.ajax({ url: this.href, cache: false, success: function (html) {
                    $("#editorRows").append(html); // add the number of rows you need here
                }
                }); return false;
            });
            $("a.deleteRow").live("click", function () { $(this).parents("div.editorRow:first").remove(); return false; });
        });  
    </script>   
    

    Add your partials to the form via your controller

    public ActionResult AddPackages()
    {
        return PartialView("PackageRow", new PackageViewModel { ... });
    }
    

    Save the data

     [Authorize]
     [HttpPost]
            public ActionResult CreatePackages(int id, FormCollection fc)
            {
    
                int nrKeys = fc.AllKeys.Count();
                int i = 0;
    
                int interations = (nrKeys / 2);
    
                foreach (var key in fc.AllKeys)
                {
    
                    if (nrKeys <= i)
                        break;
    
                    if (i != 0)
                    {
                        string value1 = fc[i];
                        string value2 = fc[i + 1];
                       ...
                    }
                    else
                    {
                        i++;
                    }
    
               ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following line in a JSF page: <h:commandLink action=#{myBean.test} value=Wizard Step></h:commandLink> I
Bit of a complicated SQL question here. I currently have a SELECT statement which
I begin to program some handheld program as hobby, right now i currently have
I currently have a robot with some sensors, like a GPS, an accelerometer and
I currently have a main stored procedure calling many stored procedures: Main --| --|
I currently have a site with a table that has Lat/Long float columns, and
I've been doing some work testing web applications with Cucumber and I currently have
I'm using a wizard control, step 1 has a list box with a list
I have three models, booking, room and travellers. Booking has many rooms room has
I currently have an MS Access application that connects to a PostgreSQL database via

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.