2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by munr
1

Is there a difference in handling between Session.Add("SOMETHING","somevalue") and Context.Items.Add("SOMETHING","somevalue")?

Using Session.Add, the item will be added to the session and available throughout the duration of the session, across all pages.

With Context.Items.Add, the item will be added to the current page request only and accessible up until the page finishes loading, after which the value will be lost. In my experience, this is usually used in conjunction with Server.Transfer to pass values between pages.

Hope this helps.

Mun

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.