views:

113

answers:

2

As example, I login in to the system ad... But how can i use the session function to recall the current applicationid? Which I need to store in form and to the other table of database.. Behind code.. vb not c# Thanks a lot. Your guide is appreciate .

Example.. 1. Login with the session fix (userid) in virtual studio.. 2. I wanna recall it out (userid) .. How !! Problem 1 3. Fill the (userid) to other table in database. That Y ! 4. Grid view data show with specific (userid) only.. in session !! Problem 2

Thank splattne !!

I think that show be replace the word (applicationid) to (userid) .. my mistaken... Cos after i recheck the table of aspnet_membership!!

A: 

Not sure this is what you are after but the SessionID will change event after the session starts until you actually store a value in Session. Better to come up with your own ID or SQL based identity and store that in Session.

Andrew Robinson
+2  A: 

The ASP.NET Session isn't a function, but an object, more specifically a specialized Collection (SessionStateItemCollection) kept in memory with a timeout specified. You can insert data (other objects) in that "container" using strings as keys like "UserName", for example:

Session("UserName") = "billg"

You can retrieve that value the same way:

Dim UserName as String = Session("UserName")

You can find an Overview to Session State on MSDN.

splattne