What do you think it's the best way to create a wizard over several pages in asp.net-mvc ? I am thinking to:
您认为在asp.net-mvc中创建多个页面向导的最佳方法是什么?我在想:
- create a hidden field in every page which contain my whole object serialized
- override OnActionExecuting -> get my object from the hidden or tempdata
- override OnResultExecuted -> put the object in tempdata, when i go to the next page(when redirect)
在每个包含序列化整个对象的页面中创建一个隐藏字段
override OnActionExecuting - >从hidden或tempdata中获取我的对象
override OnResultExecuted - >将对象放入tempdata,当我转到下一页(重定向时)
1 个解决方案
#1
6
- Wrap each step in the wizard in some
<form>
element
在一些
<input type='submit'>
在进行下一步时(通过javascript或通过提交表单)
处理表单以提取用户插入的数据
Session
variable, and retrieve the object when in the form-post将以前存储的答案存储在Session变量中,并在表单中检索对象
Session
添加新答案,然后在Session中重新保存对象
完成后,检索对象,并保留设置。
Just have some
只是有一些
[Serializable]
public class WizardAnswers
which contains properties for each wizard-answer to save the user's data in.
其中包含每个向导的属性 - 用于保存用户数据的答案。
#1
6
- Wrap each step in the wizard in some
<form>
element
在一些
<input type='submit'>
在进行下一步时(通过javascript或通过提交表单)
处理表单以提取用户插入的数据
Session
variable, and retrieve the object when in the form-post将以前存储的答案存储在Session变量中,并在表单中检索对象
Session
添加新答案,然后在Session中重新保存对象
完成后,检索对象,并保留设置。
Just have some
只是有一些
[Serializable]
public class WizardAnswers
which contains properties for each wizard-answer to save the user's data in.
其中包含每个向导的属性 - 用于保存用户数据的答案。