Beispiel #1
0
        public ActionResult WizardStep1(Step1Model step1Model)
        {
            if (!ModelState.IsValid)
            {
                return(View(step1Model));
            }

            //all good
            //set model for step1 and redirect to step2
            var wizardModel = (WizardModel)Session[step1Model.WizardId];

            wizardModel.Step1 = step1Model;

            //set category for next step
            wizardModel.Step2.CategoryId = step1Model.CategoryId;

            //clear the meals (for when we go back)
            wizardModel.Step2.MealIds = null;

            //go to next step
            //return Json(new { nextUrl = Url.Action("WizardStep2", new { WizardId = wizardModel.Id }) });
            return(RedirectToAction("WizardStep2", new { WizardId = wizardModel.Id }));
        }
        public ActionResult WizardStep1(Step1Model step1Model)
        {
            if (!ModelState.IsValid)
            {
                return View(step1Model);
            }

            //all good
            //set model for step1 and redirect to step2
            var wizardModel = (WizardModel)Session[step1Model.WizardId];
            wizardModel.Step1 = step1Model;

            //set category for next step
            wizardModel.Step2.CategoryId = step1Model.CategoryId;

            //clear the meals (for when we go back)
            wizardModel.Step2.MealIds = null;

            //go to next step
            //return Json(new { nextUrl = Url.Action("WizardStep2", new { WizardId = wizardModel.Id }) });
            return RedirectToAction("WizardStep2", new { WizardId = wizardModel.Id });
        }