Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Stepper form data

I am new to dotnet core mvc. So I am asking a suggestion. I have 2 stepper form. I need to get data from this two form , do some validation and finally save this to db. How can I make view and get data from view to controller ? Should I make two view page and two controller ? Or one will be enough ?

Way to achieve this feature

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can create two separate view pages and two corresponding action methods in the controller (one for each step of the form). You can use TempData or Session to store data. Then, in the last action method, you can perform all the necessary validations and save the data to your database. Alternatively, you can use a single view page and use javascript to hide/show different parts of the form based on the current step. Finally, you can use a single action method in the controller to handle the submission and processing of the entire form data.

Tell me if this helps 🙂

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading