最后提交(确认视图)之前显示表单数据 [英] Display form data before final submission (confirmation view)

查看:128
本文介绍了最后提交(确认视图)之前显示表单数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要给用户一个机会,看看他输入的内容,并验证其数据获得之前提交。当用户点击提交表单我想显示的形式进入到独立的页面的所有数据。当用户点击该网页上的验证数据,然后再回到控制器,最终提交的数据。

I need to give user a chance to see what he entered and verify it before data get submitted. When user click on submit form I want to display all data entered in form into separate page. When user clicks verify on that page then data go back to controller that finally submits the data.

我认为主要的问题是,如何将所有形式的数据从一个页面移动到另一个页面。

I think the main problem is that how to move all form data from one page to another page.

推荐答案

这样做会创建一个新的控制器动作,例如,VerifySubmission的一种方式。提交表单应该张贴到YourController.VerifiySubmission()。对于VerifySubmission视图显示数据,使用户可以查看它,也写出来的领域作为隐藏表单域。有这个验证页面上的提交按钮,当用户点击它,它POST的隐藏表单域的最后的FormSubmit控制器操作(无论你把它命名),它被保存到数据库中。

One way to do it would be to create a new controller action, e.g., "VerifySubmission". Submitting your form should post to YourController.VerifiySubmission(). The View for VerifySubmission displays the data so the user can review it, and also writes out the fields as hidden form fields. There is a submit button on this "verify" page, when the user clicks it, it POST's the hidden form fields to your final "FormSubmit" controller action (whatever you have named it), where it gets saved to the database.

编辑:另外,请因此它给人的什么质疑你是问一些迹象更新问题的标题。

Also, please update the title of your question so it gives some indication of what question you are asking.

这篇关于最后提交(确认视图)之前显示表单数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆