Barrigon
Barrigon

Reputation:

ASP.net MVC - ViewModel object and Session variables

Say I have the following situation:

I would like to store the page number and the filter properties somewhere in such a way that when the user returns to Contacts/Index page, the same page number and filters are applied.

Is it good practice to store these properties within a Session variable? Should the ViewModel be handling these Session variables?

Is there another way to tackle this type of situation?

Upvotes: 2

Views: 2778

Answers (1)

Omu
Omu

Reputation: 71198

if you want to have the same filters/page after you have returned from another page back, then you must use session, there is no other better way

Upvotes: 3

Related Questions