I know I can reference a simple session variable (ie: string) in javascript like this:
var SesVar = '<%= Session(MySessionVariable) %>';
alert(SesVar);
But the problem I have is that I have an ASP.NET generic list object stored in Session.Contents. The object looks like this:
Public Class LetterReason
Private _reasonCode As String
Public Property ReasonCode() As String
Get
Return _reasonCode
End Get
Set(ByVal value As String)
_reasonCode = value
End Set
End Property
Private _reason As String
Public Property Reason() As String
Get
Return _reason
End Get
Set(ByVal value As String)
_reason = value
End Set
End Property
I've stored a list of this object in session contents like so:
Dim lsReasons As New List(Of LetterReason)
lsReasons = MyWCF.Get(reasons)
Session.Contents(lsReasons) = lsReasons
Problem is, when I use the code above (SesVar), it returns this:
System.Collections.Generic.List`1[LetterWriterASP2.ServiceReference1.LetterReason]
Is there any way I can access a list stored in session contents through javascript?
Thanks,
Jason