Click here to Skip to main content
11,409,766 members (39,075 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Linux MVC
Hi,
I want to retrive value from multiple table in mvc .
Posted 28-Nov-12 1:21am
Mithkr878
Comments
Richard MacCutchan at 28-Nov-12 6:33am
   
Then you need to either do it, or explain what your problem is. We cannot see your coding or read your mind.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

There are two ways of doing it.

1. Do it through controller.
2. Create view model that contains object of multiple tables and use that view model wherever you need it.

hope it helps...

Sagar Solanki
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hai

1. You can create a View Model as mentioned in this reference Multiple Models in a View in ASP.NET MVC 4 / MVC 5[^]


2. You can use PartialView or PartialAction in your view to load the different model from the controller

you can also refer this link to view small examples on each http://stackoverflow.com/questions/5763631/multiple-models-in-a-single-view-c-mvc3[^]

Hope it helps
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 300
1 OriginalGriff 285
2 Dave Kreskowiak 115
3 Andy Lanng 115
4 Maciej Los 100
0 Sergey Alexandrovich Kryukov 8,731
1 OriginalGriff 6,895
2 Maciej Los 3,332
3 Abhinav S 3,248
4 Peter Leow 3,059


Advertise | Privacy | Mobile
Web04 | 2.8.150414.5 | Last Updated 13 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100