Hi, I understand this may have been asked before but I cannot find exactly what I'm looking for, so here goes.
I need to create a wizard/multi step form in Umbraco 6.1 website and would like to know how anyone else would approach this in terms of redirecting/moving between different steps in the process.
So far I've setup all the actions and surface controllers and I would ideally like to perform a Post-Redirect-Get between each step in the process which would mean some kind of redirect but how do I load the normal master template the other umbraco pages use?
I kind of just need advice as how people use the CurrentUmbracoPage(), RedirectToUmbracoPage() and RedirectToUmbracoPage(int id) methods.
The strategy I'm currently using is Ajax and Partial views but I'm always stuck with the same URL and back/forward browser buttons are redundant unless I do some funky historyjs stuff.
I used solution 3 for a project and stored the data in a session so even if the user navigated away to another page and got back all the data was still available.
If want an example of how to create forms with MVC have a look at the Hybrid Framework.
I need to create some MVC wizard style apps as well... the wizard steps are dynamic in the sense that the data from the previous steps determine what form elements (and how many) are dynamically generated in the new step... I've created some ajax based wizards that work great for non-dynamic elements but once it gets dynamic, it appears to get tricky from there on out... this was way easy in .NET forms but in MVC looks like the partials aren't rendering correctly after step 1 (routing?)... I've tried Ajax.BeginFormExt and Html.BeginUmbracoForm with no luck... many thanks in advance!
did some playing around with the above suggestions and think I may go the Html.BeginUmbracoForm and the separate page route... would like to not have to add a separate page for each step but at least initially passing a querystring variable looks to effect the routing when the form is submitted...
Use Ajax and return partial views to the same Umbraco page <- this works would when no dynamic controls or form elements athough I believe knockout could be used but am trying to keep this as simple as possible and also keep unobtrusive validation intact
Postback to the same page with a query string parameter, e.g ?step=1 and choose the correct action to render in a condition statement <- from my initial testing, passing a querystring variable appears to get appended to the form action and then affects the MVC routing (I may be wrong about this)
Create multipe umbraco pages each with a different action/controller embedded or in a macro <- this seems to work and as Jeroen states by storing the object data in session, makes for easy persisting and pre-population...
will continue working through this but a lot of good advice from above. thanks guys!
Process for creating MVC forms
Hi, I understand this may have been asked before but I cannot find exactly what I'm looking for, so here goes.
I need to create a wizard/multi step form in Umbraco 6.1 website and would like to know how anyone else would approach this in terms of redirecting/moving between different steps in the process.
So far I've setup all the actions and surface controllers and I would ideally like to perform a Post-Redirect-Get between each step in the process which would mean some kind of redirect but how do I load the normal master template the other umbraco pages use?
I kind of just need advice as how people use the CurrentUmbracoPage(), RedirectToUmbracoPage() and RedirectToUmbracoPage(int id) methods.
The strategy I'm currently using is Ajax and Partial views but I'm always stuck with the same URL and back/forward browser buttons are redundant unless I do some funky historyjs stuff.
Paul,
For E99 purchase contour you could save youself alot of work it works in mvc mode and webforms mode it will do exactly what you need.
Regards
Ismail
Hi Ismail,
Thanks for the recommendation but I'm just working on my own and don't want to spend any money on plugins.
The solutions I have thought of so far are:
1. Use Ajax and return partial views to the same Umbraco page
2. Postback to the same page with a query string parameter, e.g ?step=1 and choose the correct action to render in a condition statemen
3. Create multipe umbraco pages each with a different action/controller embedded or in a macro
Hello,
I used solution 3 for a project and stored the data in a session so even if the user navigated away to another page and got back all the data was still available.
If want an example of how to create forms with MVC have a look at the Hybrid Framework.
Jeroen
Thanks Jeroen,
I'll check out the Hybrid Framework, it looks really good at first glance.
I need to create some MVC wizard style apps as well... the wizard steps are dynamic in the sense that the data from the previous steps determine what form elements (and how many) are dynamically generated in the new step... I've created some ajax based wizards that work great for non-dynamic elements but once it gets dynamic, it appears to get tricky from there on out... this was way easy in .NET forms but in MVC looks like the partials aren't rendering correctly after step 1 (routing?)... I've tried Ajax.BeginFormExt and Html.BeginUmbracoForm with no luck... many thanks in advance!
did some playing around with the above suggestions and think I may go the Html.BeginUmbracoForm and the separate page route... would like to not have to add a separate page for each step but at least initially passing a querystring variable looks to effect the routing when the form is submitted...
Use Ajax and return partial views to the same Umbraco page <- this works would when no dynamic controls or form elements athough I believe knockout could be used but am trying to keep this as simple as possible and also keep unobtrusive validation intact
Postback to the same page with a query string parameter, e.g ?step=1 and choose the correct action to render in a condition statement <- from my initial testing, passing a querystring variable appears to get appended to the form action and then affects the MVC routing (I may be wrong about this)
Create multipe umbraco pages each with a different action/controller embedded or in a macro <- this seems to work and as Jeroen states by storing the object data in session, makes for easy persisting and pre-population...
will continue working through this but a lot of good advice from above. thanks guys!
is working on a reply...