You can use the attribute that I found on net , which processes several buttons in the same form. This will determine what action is performed on the controller. Thus, you can have 4 actions on the controller, and the correct one, depending on which button was pressed, regardless of where it was called.
Such a small example; markup ...
<input type="submit" name="action" value="step1"/> <input type="submit" name="action" value="step2"/> <input type="submit" name="action" value="step3"/> <input type="submit" name="action" value="step4"/>
Then in the controller ...
[HttpPost] [MultiButton(MatchFormKey = "action", MatchFormValue = "step1")] public ActionResult Step1() { ... } [HttpPost] [MultiButton(MatchFormKey = "action", MatchFormValue = "step2")] public ActionResult Step2() { ... } [HttpPost] [MultiButton(MatchFormKey = "action", MatchFormValue = "step3")] public ActionResult Step3() { ... } [HttpPost] [MultiButton(MatchFormKey = "action", MatchFormValue = "step4")] public ActionResult Step4() { ... }
Then you can click between any steps in the registration process (perhaps after the check is completed and you will go through every first one) with relative ease.
Hope this helps someone. I just asked the date of the question, but thought that I would post this anyway :-)
Westdiscgolf
source share