difference between Session.item and Session

Posted on 2008-01-29
Medium Priority
Last Modified: 2013-11-26
In Asp.Net, What is the difference between Session.Item("quantity") and Session("quantity")?
In a book that I have; sometimes the code is Session.item('quantity") & sometime it is Session("quantity").

can I use them interchangably?
Please advise.

Question by:vdesai_8
  • 2
LVL 19

Accepted Solution

SteveH_UK earned 2000 total points
ID: 20772702
Yes, it is a shorthand.  Using Session("quantity") is using the default indexer, which is the Item property.

Author Comment

ID: 20773437
Thanks SteveH.
LVL 19

Expert Comment

ID: 20775073
You're welcome :)

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.
Suggested Courses
Course of the Month4 days, 15 hours left to enroll

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question