G
Guest
Hi everybody
I have a session on my vb.net web applications first page to store an one
dimensional array:
dim myAry(2) As String
myAry(0) = xVal
myAry(1) = yVal
HttpContext.Current.Session("mySession") = myAry
so far so good. Then I want to retrieve data from this session on the next
page:
dim myAry() As String
arySec = CType(HttpContext.Current.Session("mySession"), String())
dim myVal = myAry(0).ToString
This works fine when there is no error on the page but if there is any
regarding other line of codes that I've added later, it generates this error:
System.NullReferenceException: Object reference not set to an instance of an
object
and it shows my 'Response.write(strQ)' statement on the page.
Any ideas of why this happens and how I can fix it? I appreciate any help.
ASPSha
I have a session on my vb.net web applications first page to store an one
dimensional array:
dim myAry(2) As String
myAry(0) = xVal
myAry(1) = yVal
HttpContext.Current.Session("mySession") = myAry
so far so good. Then I want to retrieve data from this session on the next
page:
dim myAry() As String
arySec = CType(HttpContext.Current.Session("mySession"), String())
dim myVal = myAry(0).ToString
This works fine when there is no error on the page but if there is any
regarding other line of codes that I've added later, it generates this error:
System.NullReferenceException: Object reference not set to an instance of an
object
and it shows my 'Response.write(strQ)' statement on the page.
Any ideas of why this happens and how I can fix it? I appreciate any help.
ASPSha