Can anyone help with transferring form from one view to another in MVC3/C#?
Here is the scenario:
1) I have create page where i have about 6 field for user to enter once user submit that field it will redirect them to review page.
2) Once user come on the review page, the information he entered in the create page should appear there (for user to confirm).
3) There will be a edit button on the review page so if the user clicks on the edit button then he should go back to the create page where he had entered all information, so he can update them again.
Can we handle this scenario using ViewData/ViewBag or partial view? I don’t know how to do that.
You should create a class in your Models folder, let’s call it MyViewModel, and you’ll define in that class all the 6 property you need the user to edit.
In the create view, you’ll present all your input field inside a form element defined to postback to your review action. The significant part of your view, will be:
In MyController class, you’ll have the Review method defined as following
And at last, in your Review view, you’ll have:
Your controller class MyController will have the following code: