"johnb41" <or****@informatik.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
That was the problem that i wasn't able to figure out.
I added this line outside all sub routines:
Dim Hashtable_OrderInfo as new Hashtable(Ctype(Session("OrderInfo"),
Hashtable))
A little history: The previous page added items to the hash table. To
bring this info to the next page, i put the hashtable info into a
session variable. Then on the next page i converted the session
variable back into a hashtable (using the line of code above).
The code works perfectly fine inside of a sub routine, but when it's
outside of a routine, i get an error saying that i cannot use a session
variable.
Could you please post the error message?
Also, try doing the above step by step so you can see what step it failed
at. Try changing the hashtable to:
Protected Hashtable_OrderInfo As Hashtable()
and then, at the end of OnInit (or Page_Init, if that's how VB.NET does
things):
Dim ht As Hashtable = DirectCast(Session("OrderInfo"), Hashtable)
Hashtable_OrderInfo = New Hashtable(ht)
(use DirectCast when you know what the source type is, and you don't need it
converted to another type - you just need the actual source type
acknowledged)
John Saunders