Click here to Skip to main content
15,879,348 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,


I need some help in the following seniors:

1. I have a view page where I display around 10 records without using any filter condition.
But after all the data bind on the page, user could search a particular record or filter record.
How can I achieve this functionality using Entity framework in MVC 4.0?

2. What the best way of implementing paging in MVC 4.0 with Entity Framework?

Please advice.

Thank you,

Regards,
Ashish
Posted
Updated 29-Aug-14 1:26am
v2
Comments
ChauhanAjay 29-Aug-14 8:54am    
Try this link.
http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-application
Nathan Minier 29-Aug-14 10:00am    
You have 2 options, client-side or server side.

Personally, I feel that if you're using generally flat data, your paging should be done on the client side. The ASP MVC framework has a built in design philosophy that I greatly agree with:

1. Queries yield lists.
2. Lists yield individual detail

With that model in mind, you can push hundreds to thousands of flat entries to a client and use client-side paging with minimal performance impact on either side. The list can contain just about any number of filterable conditions locally, visible or not, in JavaScript Objects that can be manipulated locally. Load is balanced off of the server and onto the client.

So long answer short: I'd use JavaScript or a JavaScript Framework for most, if not all, paging needs, and associate a context link with the data for drill-down.

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