sortingurlparameterspaginationfiltering

How do you handle parameters for sorting, paging and filtering?


This is the usual thing: you have a list of items with several attributes. You can :

All of this gives you differents parameters for a given page:

How do you handle the propagation of all these paramters between your pages ? Let's say you can edit one item, and when you go back, you'd like to get on the same page you where.

Do you simply put all parameters in the url (and pass them as "return parameters" to the edit page) ? Do you put some in the session (maybe sort and filter parameters) ?


Solution

  • I like to make them part of the URL so that if someone bookmarks the page or emails a link to the page, it will render the page exactly the same way. You can't do that if you depend on session state.