is it possible to store list to session variable in Asp.net C# ?
See Question&Answers more detail:osis it possible to store list to session variable in Asp.net C# ?
See Question&Answers more detail:osYes, you can store any object (I assume you are using ASP.NET with default settings, which is in-process session state):
Session["test"] = myList;
You should cast it back to the original type for use:
var list = (List<int>)Session["test"];
// list.Add(something);
As Richard points out, you should take extra care if you are using other session state modes (e.g. SQL Server) that require objects to be serializable.