Mikhail

Mikhail

  • NA
  • 3
  • 0

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

Aug 4 2009 11:46 AM
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)