Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a form in which i want to save the data from the form and if the save is successful then redirect them to another page and prompting to print their Form on this page. How can i achieve this?
Posted

1 solution

Use a normal <form> submission to a controller action. Submitting forms to controllers and doing redirects from controller actions are all very basic aspects of MVC. I suggest you go through a book on mvc or at least on-line tutorials, as when you have an understanding of the basics then how to do these things becomes clear.
 
Share this answer
 
Comments
lokopi.nagar 22-Jul-15 1:20am    
Thank you for your answer but my need is to print the page after the form have been inserted to database and redirection is performed to another page and on that page i want to print the previous page data.
So it is like this
Index method is for form filling
Details method is for Form displaying to user
Accepted method is for giving confirmation message only if insertion is successful and prompting to print the Details method page on Accepted method
at first i thought to pick it from database but i am not sure if it is fine to do so
F-ES Sitecore 22-Jul-15 6:26am    
I'd either skip the confirmation bit and after submit redirect the user to a "preview" page that has the data in a printable format, or after data submission you could show a view that has the confirmation message and there will be some javascript on that page to use window.open to open the preview page in other window.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900