Where and which data to save into session on an ASP.NET MVC 2 application?

Posted by Shaharyar on Stack Overflow See other posts from Stack Overflow or by Shaharyar
Published on 2010-02-20T18:42:46Z Indexed on 2010/04/01 2:13 UTC
Read the original article Hit count: 367

Filed under:
|
|
|

I am having some trouble saving the state of my current view.

Currenly I have several selectlist calling their own Action method on the controller that returns the Index view with the filtered model based on the values of the selectlist.

I have also written a little FileResult action that creates a csv file based on the current model. But I am only covering one selectlist right now as I only save the value of selectList1 into the session and access it with Session["SelectListValue1"]

  • What are the best practices in this situation?
  • Should I redo the entire (each action for each SelectList) part?
  • Should I save each SelectLists value into the session and check if it's null?
  • Or should I just save the Lambda Expression into the session and modify it during every call?

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET