VB.NET
Dim x As New SortedList()
x.Add('Key1', 'ValueA')
x.Add('Key2', 'ValueB')
To store in Session:
Session('SortedList1') = x
and to retrieve
Dim y As SortedList = CType(Session('SortedList1'), SortedList)
C#
SortedList x = new SortedList();
x.Add('Key1', 'ValueA');
x.Add('Key2', 'ValueB');
To store in Session:
Session['SortedList1'] = x;
and to retrieve
SortedList y = (SortedList) Session['SortedList1'];
Share with