on form submission/post = fields retain user submitted form values plus binds data to grid... user can do sorting, paging, etc in grid retains user submitted form values
is it best to have all the form input and results defined in the model... in the controller on the submit action, store that results and form data in viewdata/tempdata and then return RedirectToCurrentUmbracoPage, repopulate the form and if results exist then bind and display them in the grid?
what is the best way to set this up in MVC?
I want to setup a membership search form.
initial page load = user inputs search criteria (name, address, state, country, etc), clicks submit
on form submission/post = fields retain user submitted form values plus binds data to grid... user can do sorting, paging, etc in grid retains user submitted form values
is it best to have all the form input and results defined in the model... in the controller on the submit action, store that results and form data in viewdata/tempdata and then return RedirectToCurrentUmbracoPage, repopulate the form and if results exist then bind and display them in the grid?
many thanks in advance!
Hi what version of Umbraco and are you using razor?
What you really need is a View say called Form
In Form call a partial called formContent
in form content you want to pass in a data model with some properties such as
public string firstName {get;set;}
public string lastName{get;set;}
In the partial use either Html.BeginForm{} or Ajax,BeginForm to post to a surface controller
and then return the result.
Hope this makes sense. Let me know if it does not and i will help some more :). Charlie.
This could help :)
http://www.charlesafford.com/setting-up-and-using-your-first-surface-controller.aspx
thx Charles that's similiar to the route I end up taking...
No worries John, sorry for the late reply.
If you could vote for me
http://our.umbraco.org/people/mvps
That would be great ;)
is working on a reply...