In a VS 2005 I had problems getting to the session object. At first it looked like a security issue with IE, but that did not fix the problem. A little experimenting revealed someting weird.
The situation : fresh Virtual PC, all updates applied, no IIS.
Take this code
Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
ListBox1.Items.Add(Session.SessionID)
End Sub
It adds the seesion ID of the roundtrip to the listbox. Every roundtrip has a new ID. I need that ID to identify the session.
Trying to see more I stored something in the session.
Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
ListBox1.Items.Add(Session.SessionID)
Const MySessionMember As String = "JustME"
Try
Label1.Text = Session.Item(MySessionMember).ToString
Catch ex As Exception
Label1.Text = "Not found.."
End Try
Session.Item(MySessionMember) = TextBox1.Text
End Sub
This works perfectly and the weird thing is that the SessionID is now constant over the roundtrips. And becomes usable.
I guess this a bug /over-optimization in VWD ?
Peter