O'Reilly logo

ASP.NET MVC with Entity Framework and CSS by Lee Naylor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

© Lee Naylor 2016

Lee Naylor, ASP.NET MVC with Entity Framework and CSS , 10.1007/978-1-4842-2137-2_5

5. Sorting, Paging, and Routing

Lee Naylor

(1)Newton-le-Willows, Merseyside, UK

This chapter focuses on adding, sorting, and paging products and adding support for friendly URLs to use the ASP.NET Routing feature.

Note

If you want to follow along with the code in this chapter, you must either have completed Chapter 4 or download Chapter 4’s source code for from www.apress.com as a starting point.

Sorting Products by Price

To demonstrate sorting, I’ll show you a simple example to sort products by price, allowing users to order products by price.

First of all, add a new switch statement to the Index method of the Controllers\ProductsController.cs file, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required