I have an checkout process that's needs to be a step-by-step kind of function. My thoughts was to create a Surface Controller and have each step as a method. I found some guides using one method and a save feature, but I can't figure out how I should do if I want multiple steps with savings after each.
Each step has a method in the surface controller like
[HttpGet]
[ActionName("ContactInfo")]
public ActionResult ContactInfo()
and returns a partial view
return PartialView("ContactInfo", model);
The view has a model @model CheckOut.ContactInfoModel
and a form @using (Html.BeginUmbracoForm("ContactInfo", "OrderSurface", FormMethod.Post))
I tried to create a macro and add the first page (a welcome page) and it worked. But when I post that and then render the contactinfo view there is a problem since it don't inherit Umbraco.Web.Models.RenderModel
I have search to find a best practice but can't find any good solutions. Each step is idependent (display -> save) but I need to make sure it's in a certain order.
I have seen this post but then I have to create a umbraco page/node for each step and also a macro, is that the best way? Havn't worked with Umbraco for so long so I think I need some help making my decision.
Surface Controller with step by step functions
Hi
I have an checkout process that's needs to be a step-by-step kind of function. My thoughts was to create a Surface Controller and have each step as a method. I found some guides using one method and a save feature, but I can't figure out how I should do if I want multiple steps with savings after each.
Each step has a method in the surface controller like
The view has a model @model CheckOut.ContactInfoModel
and a form @using (Html.BeginUmbracoForm("ContactInfo", "OrderSurface", FormMethod.Post))
I tried to create a macro and add the first page (a welcome page) and it worked. But when I post that and then render the contactinfo view there is a problem since it don't inherit Umbraco.Web.Models.RenderModel
I have search to find a best practice but can't find any good solutions. Each step is idependent (display -> save) but I need to make sure it's in a certain order.
I have seen this post but then I have to create a umbraco page/node for each step and also a macro, is that the best way? Havn't worked with Umbraco for so long so I think I need some help making my decision.
Jan,
Take a look at http://umbraco.com/follow-us/blog-archive/2015/2/13/creating-multi-step-forms-using-a-surfacecontroller its step by step guide.
Regards
Ismail
is working on a reply...