Click here to Skip to main content
15,891,763 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
i have create a viewmodel from 3 models(table) in mvc4.when data come from controller to view pagelist is not supported for a viewmodel.
Posted

1 solution

Ideally paging should happen in the stored procedure.

If this is collection sort of a data, which it appears like, because you are combining 3 models to make the view model - then I would say paging should happen still at the stored procedure and then the VM should be populated accordingly.

If you don't have stored procs and use an ORM instead, then the ORM should do the paging and populate the VM. In this case you should not use your original models any more and only use the VM directly to pass data.

Hope this helps.
 
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