I'd do this with the ASP.NET Cache API - here's how.
Imports System.Web
Public Class CacheManager
Private ListKey As String = "MyList"
Public Shared ReadOnly Property TypedList As List(Of Integer)
Dim cachedObject As Object
Dim myList As List (Of Integer)
Dim userCacheKey As String = ListKey & HttpContext.Current.User.Identity.Name
'First check to see if List is in the cache already
cachedObject = HttpRuntime.Cache.Get(userCacheKey)
If cachedObject Is Nothing Then
'If List isn't in the cache already then get it...
myList = Code to retrieve list members goes here
' ...and now we've got it put it in the cache
HttpRuntime.Cache..Add(key:=userCacheKey, value:=myList, absoluteExpiration:=HttpRuntime.Cache.NoAbsoluteExpiration, slidingExpiration:=New TimeSpan(0,5,0), dependencies:=Nothing, onRemoveCallback:=Nothing, priority:=CacheItemPriority.Default)
Else
'List is already in the cache but everything comes out of the cache as System.Object so cast it to List (Of Integer)
myList = DirectCast(cachedObject, List (Of Integer))
End If
'Now we have List, return it to the caller
Return myList
End Property
End Class
This gives us a class that will hold an instance of List<> per user that exists in memory for five minutes after the last time it was accessed - you can up this just by changing the length of the TimeSpan object in the slidingExpiration parameter when the List is added to the Cache.
Your usage in the page is then simply:
Public Sub Page_Load (arguments)
Dim myList As List(Of Integer)
...
myList = CacheManager.TypedList
...
End Sub
<WebMethod()> Public Sub MyEventMethod(arguments)
Dim myList As List(Of Integer)
...
myList = CacheManager.TypedList
...
End Sub
It's not quite clear (to me) from your question whether users can change their individual List or they change the global list. If they change their individual list that's easy to cater for - change the TypedList property like this:
Imports System.Web
Public Class CacheManager
Private ListKey As String = "MyList"
Public Shared Property TypedList As List(Of Integer)
Get
Dim cachedObject As Object
Dim myList As List (Of Integer)
Dim userCacheKey As String = ListKey & HttpContext.Current.User.Identity.Name
'First check to see if List is in the cache already
cachedObject = HttpRuntime.Cache.Get(userCacheKey)
If cachedObject Is Nothing Then
'If List isn't in the cache already then get it...
myList = Code to retrieve list members goes here
' ...and now we've got it put it in the cache
HttpRuntime.Cache.Add(key:=userCacheKey, value:=myList, absoluteExpiration:=HttpRuntime.Cache.NoAbsoluteExpiration, slidingExpiration:=New TimeSpan(0,5,0), dependencies:=Nothing, onRemoveCallback:=Nothing, priority:=CacheItemPriority.Default)
Else
'List is already in the cache but everything comes out of the cache as System.Object so cast it to List (Of Integer)
myList = DirectCast(cachedObject, List (Of Integer))
End If
'Now we have List, return it to the caller
Return myList
End Get
Set (ByVal value As List(Of Integer))
Dim userCacheKey As String = ListKey & HttpContext.Current.User.Identity.Name
HttpRuntime.Cache.Insert(key:=userCacheKey, value:=value, absoluteExpiration:=HttpRuntime.Cache.NoAbsoluteExpiration, slidingExpiration:=New TimeSpan(0,5,0), dependencies:=Nothing, onRemoveCallback:=Nothing, priority:=CacheItemPriority.Default)
End Set
End Property
End Class
If any user making changes to the list changes it for everybody, then I'd look at using a CacheDependency.