Session management in user control

  • Thread starter Thread starter vikram
  • Start date Start date
V

vikram

I am using below mention code in a web usercontrol for
session management for hastable objects.
Code works sometime and sometime it doesnt work. Is there
some problme in code:

Private Sub SaveState()

Session.Item(Me.ID & "cols") = ColumnsListHashTable
Session.Item(Me.ID & "status") = StatusHashTable
End Sub
Private Sub GetState()
ColumnsListHashTable = Session.Item(Me.ID & "cols")
StatusHashTable = Session.Item(Me.ID & "status")

End Sub
 
Hi vikram:

By not work, do you mean you get a null reference exception?
 
yes i get null objects sometimes and sometimes i get
objects perfectly right.
 
I'd put a breakpoint in both methods, or trace statements, andmake
sure SaveState is always called before GetState.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top