Sorting, Filtering, and Paging with the Entity Framework in an ASP.NET MVC Applicationhttp://asp.netWed, 05 Feb 2014 13:05:00 GMTumbracoComments for Sorting, Filtering, and Paging with the Entity Framework in an ASP.NET MVC ApplicationenComment Posted by nstuyvesanthttp://asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-applicationMon, 04 Nov 2013 21:48:26 GMT00000000-0000-0000-0000000021756Great examples of things everyone can use! If someone performs a search, then a sort, edits a record on page 4, then hits Save or Back to List, their page, currentFilter, and sortOrder are lost. Perhaps this example could be enhanced to show those values being retained through an Edit (probably less of a concern for Create)?]]>Comment Posted by tdykstrahttp://asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-applicationFri, 08 Nov 2013 12:57:28 GMT00000000-0000-0000-0000000021846@nstuyvesant - Thanks for the suggestion, we'll add that to our list for the next tutorial version.

showing error at line 66 as "The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'."

]]>Comment Posted by tdykstrahttp://asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-applicationTue, 12 Nov 2013 21:03:30 GMT00000000-0000-0000-0000000021903@jomykanjal - Yes, both are the same.]]>Comment Posted by tdykstrahttp://asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-applicationTue, 12 Nov 2013 21:06:38 GMT00000000-0000-0000-0000000021904@mr. amol parsewar - I haven't seen that error, and the preceding switch statement should ensure that orderby is applied before you get to the ToPagedList method. Do you get the error in the downloaded project? If that works for you, compare that code to what you created to see if there's any difference. If you continue to get the error please indicate the exact steps you go through to get the error.

]]>Comment Posted by smartarshhttp://asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-applicationWed, 27 Nov 2013 13:41:04 GMT00000000-0000-0000-0000000022100I am new to the MVC Pattern in ASP.NET and i must say i got to learn a lot from all the tutorials posted by all of you. :)

Each article has something new to learn, that too in a very detailed manner and as easy as possible. :)

How to call it in controllers? Should we need to write Dispose (); to run it?

I know it is a dummy question and i'm new to MVC Please advise

Thanks

Yi he

]]>Comment Posted by tdykstrahttp://asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-applicationTue, 17 Dec 2013 18:24:42 GMT00000000-0000-0000-0000000023342@dddyaspnet - The framework calls it; the base controller class implements IDisposable. All you have to do is add the override method.]]>Comment Posted by Zaheer A.M.http://asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-applicationThu, 02 Jan 2014 05:42:28 GMT00000000-0000-0000-0000000023496This is good one tutorial for sorting,paging and filtering without using jquery datatables. ]]>Comment Posted by Zaheer A.M.http://asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-applicationThu, 02 Jan 2014 05:59:47 GMT00000000-0000-0000-0000000023497Sir, Is any ways to filtering data without sending it to the contoller.How can filtering all records in the table at a time(such as number,date,name etc)?

thank you

]]>Comment Posted by tdykstrahttp://asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-applicationThu, 02 Jan 2014 11:49:56 GMT00000000-0000-0000-0000000023499@zaheer - at this point in the tutorial, the students variable in the Index method is an IQueryable, so when you add a Where clause, that is sent to the database and only filtered data is returned to the controller. That changes later in the repository tutorial. You could write the repository to send filtering criteria to the database also, and that's discussed in the repository tutorial.

Walks through a series of common patterns, with a great explanation for why and how the code works

]]>Comment Posted by dotnetnoob101http://asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-applicationWed, 22 Jan 2014 09:27:56 GMT00000000-0000-0000-0000000023805Fabulous tutorial. One of the best I've found on the internet regarding this subject. Applied to my own application and everything worked spot on first time!]]>Comment Posted by Marijn van Herelhttp://asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-applicationTue, 28 Jan 2014 07:57:06 GMT00000000-0000-0000-0000000023894Hi Tom,

I'm just starting on MVC and doing your tutorial. It would be nice if you could explain each component we are copying and pasting. I would like to understand what it all is. Maybe I am getting ahead of myself here, Things may get explained later on.

Sometimes I wonder why copy or add this or that.

For the rest great stuff and thanks.

]]>Comment Posted by Ddemoelhttp://asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-applicationTue, 28 Jan 2014 14:25:37 GMT00000000-0000-0000-0000000023900Hmm. For some reason PagedList is not working for me in the View. I get the error: "The type or namespace 'PagedList' could not be found". I have, however, installed the PagedList.Mvc NuGet package mentioned in this tutorial, and it works fine in the controller. Anyone an idea?]]>Comment Posted by Ddemoelhttp://asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-applicationTue, 28 Jan 2014 14:35:43 GMT00000000-0000-0000-0000000023901nvm, reinstalling the package 3 times solved it -_-]]>Comment Posted by tdykstrahttp://asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-applicationTue, 28 Jan 2014 15:10:52 GMT00000000-0000-0000-0000000023902@Marijn van Herel - Thanks for the suggestion. We try to explain everything we think might not be clear but what some people need isn't what others need, so the choice isn't always obvious. If you could specify what isn't clear, that would be helpful and we'll take that into account when we have a chance to update the tutorial.]]>Comment Posted by olevvaherhttp://asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-applicationWed, 05 Feb 2014 10:01:23 GMT00000000-0000-0000-0000000024032in the step "Add Paging Functionality to the Index Method" you must colorize one change also to yellow: "ViewResult" (before was ActionResult):

I got errors, when replace method name to VieResult (and made restart to VS), works.

]]>Comment Posted by tdykstrahttp://asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-applicationWed, 05 Feb 2014 13:05:00 GMT00000000-0000-0000-0000000024034@olevvaher - Thanks for reporting that, we'll correct the inconsistency in the next update of the tutorial. Meanwhile, are you sure your error was related to ActionResult vs. ViewResult? AR is more general than VR, so I don't see how changing AR to VR would correct a problem.]]>