views:

22

answers:

1

In our application we are using ASP.NET MVC. On a page we are displaying 10 results per page by default. We want to let the user change this default value of 10 to 20 or 30 or 40. When it is changed, is it good to persist this changed value? To me it looks good to persist the value so that user does not have to change it every time.

My other question is if we decide to persist the value, is it good persist

  1. in the session.
  2. on client side using cookie.
  3. on server side in both session and database.

EDIT:

I know it is driven by application requirements to some extent. I want to know what is the practice that others follow.

+1  A: 

I think it can be good to persist this value, at least for the session. It really depends; do you have other paged data that would use such a value, too? and would it make sense for the same changed value to be used for the others? If so, you need to persist it somewhere.

I would tend to prefer a cookie for this one, I think; either session or reasonably persisted. But if it's something that you think would be useful for the person to have that setting persisted all the time, perhaps storing it in a user profile (in a DB, that is) could be helpful.

Andrew Barber
Best option. Keep it simple with a cookie, then stash in a database if the package users request this value to be persisted across machines.
amarsuperstar