停止回发,手动执行
我的主页是带有模型的注册表单。当用户单击提交按钮时,模型将进行验证并发布。然而,我需要在这之间采取一个步骤,迫使用户同意一些条款和细则。
最初,我想将模型带入第二个确认页面,然后转到保存信息的第三个 ActionResult。
其次,我想隐藏主 DIV,然后显示协议“存在”的第二个 DIV,然后发回。但我不确定在显示第二个 DIV 之前如何验证模型,然后发布表单。
My main page is a registration form with a Model. When the user clicks the submit button, the model validates and posts. However, I am in need of a step in between that forces the user to agree to some terms and fine print.
Originally, I was thinking that I would carry the model into a second confirmation page and then move onto a third ActionResult that saved the information.
Second, I thought of just hiding the main DIV and then showing a second DIV that the agreements "live" in and then post back. But I'm not sure how I would validate the model before showing the second DIV and THEN post the form.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为什么不将细则和条款(以及相应的复选框)作为注册表的一部分?几乎所有地方都是这样做的,不是吗?
Why not just include the fine print and terms (and corresponding checkbox) as part of the registration form? That's how it's done pretty much everywhere, isn't it?
如果用户可能拒绝您的条款和细则,为什么还要额外调用来验证模型呢?我认为您应该按照@Daniel 的建议进行操作,或者如果您必须这样做,则发布您的模型,返回验证,显示您的细则,然后再次将表单发布到不同的操作以保存。
Why make an extra call to validate the model if the user might reject your terms and fine print. I think you should either do what @Daniel recommends or if you must do it this way, post your model, get the validation back, show your fine print and then post the form again to a different action to save.