2
Answers

How to preserve value of Page's property between postbacks?

Mikhail

Mikhail

15y
6k
1
Hi all.

Is it possible to:
1) put some value into, say, this property/field:
public ShoppingCart Cart;
defined in, say, _Default class, then
2) postback to this same page (not crosspage postback, PreviousPage will remain null) and
3) get value of Cart defined during previous request to this same page?

_Default class is derived from System.Web.UI.Page class, it's just a common ASP.NET web page.


Do I have to create some repository class just to store non-string values between page requests?
Answers (2)