开发者

Multi-page wizard in MVC - where to store the entered data

What do you think it's the best way to create a wizard over several pages in asp.net-mvc ? I am thinking to:

  1. create a hidden field in every page which contain my whole object serialized
  2. override OnActionExecuting -> get my object from the hidden or tempdata
  3. override OnResultExecuted -> put the object in tempdata, when i go to the nex开发者_如何学JAVAt page(when redirect)


  1. Wrap each step in the wizard in some <form> element
  2. Do a form submit when going to the next step (either through javascript or via <input type='submit'>
  3. Handle the form-post to extract the data inserted by the user
  4. Store your previously stored answers in a Session variable, and retrieve the object when in the form-post
  5. Add the new answers, and re-save the object in Session
  6. When finishing, retrieve the object, and persist the settings.

Just have some

[Serializable]
public class WizardAnswers

which contains properties for each wizard-answer to save the user's data in.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜