Preferred Method To Assign Session Variable Values

  • Thread starter Thread starter Matt
  • Start date Start date
M

Matt

All -

Is there a preferred method to assign session variables in ASP.NET /
VB.NET?

It looks like you can do any of the following to assign values:

Session.Item("Foo") = "Bar"
Session("Foo") = "Bar"
Sesssion.Add("Foo", "Bar")

It looks like you can do either of the following to get values:

strBar = Session.Item("Foo")
strBar = Session("Foo")

Are there advantages/disadvantages to any of these approaches or do
they all get you the same thing?

Thanks,

- Matt
 
They're all fine.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
Back
Top