How do I handle page flow in MVC (particularly asp.net)

后端 未结 5 1848

If you had to provide a wizard like form entry experience in mvc how would you abstract the page flow?

5条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-10 02:00

    In order to keep the steps you could implement a page flow action filters, which provide an experience like this one:

    [RequiredStep(FlowStart = true)]
    public ActionResult Confirm()
    {
        return View();
    }
    
    [RequiredStep (PreviousStep = "Confirm")]
    public ActionResult ExecuteOrder()
    {
        return RedirectToAction("ThankYou");
    }
    
    [RequiredStep(PreviousStep = "ExecuteOrder")]
    public ActionResult ThankYou()
    {
        return View();
    }
    

提交回复
热议问题