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.
 

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