Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new to MVC framework. below are my questions. as I'm new to this framework, Please give a detail info how to achieve it.

1) Is it possible to retrieve all the data from these tables through single view.

2) If yes then what will be the procedure to generate such kind of view.

3) what will be the view code of the diagram.

4) Last question : on a single submit button how to pass all these data to controller to add it to the database. Frown

I would really appreciate if anyone can help me out on this.

I am using Asp.net MVC5, EF6(Database first)

Database Diagram:- http://i.stack.imgur.com/uthtl.png
Posted

1 solution

Hi,

You can use the ViewModel concept in the MVC. Create a view model with all the required tables as the properties and set the values to the property. You can pass the new ViewModel to the view, so that all the models(tables) are in the single View.

You can follow up this article Multiple Models in a View in ASP.NET MVC 4 / MVC 5[^]

As you bind the model to the View as strongly bind, you can use the same model to update or you can use the FormCollection too.
 
Share this answer
 

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