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?
Loading
MikhailPosted Aug 5, 2009, 10:50 AM
HttpContext.Current.Session[] seems more convenient to me, because ViewState requires serializable data.
But both seem almost as cumbersome as having custom repository class for just passing values between instances of Page.
Is there a way to preserve previous instance of Page and pass it to the next instance in property?
PreviousPage contains previous instance on cross-page Postback, but it's empty when Page posts back to itself.
Roei BarPosted Aug 4, 2009, 2:53 PM