开发者

asp mvc, best solution to store user input data before it will be saved to database

for example i've got a form with some input fields(every form and it's inputs with validation rules are stored in database). Every input got it's own OnChange() which posts json (i.e. new value, input element name, ...) to controller for val开发者_如何学Cidation, if validation passes the new value must be saved somewhere until user clicks submit button, which will save all data to database table.

And here i'd like to ask, what this special place between ui and database can be ?

p.s. also if user closes browser/form the next time he'll come back i need to ask him if he would like to start from an empty form or fill form with values he previously entered there.

Thank You !


Cookies or intermediary database table would work for this case.


for an intermediary database like that, you could use something like MongoDB, it is really easy to get it started, you just work with the classes you have, don't need to setup any schema, you just save the objects

http://www.mongodb.org/display/DOCS/CSharp+Driver+Tutorial


If you are submitting the entire form at the end, why can't you just store the values at that time? Is this a multi-page form(s)? Why not allow the database records to be partially filled? You could always add a bit column to mark the record as complete or incomplete. This would be much simpler than duplicating your table structure.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜