By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,025 Members | 2,118 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,025 IT Pros & Developers. It's quick & easy.

Persist a stack across PostBacks?

P: n/a
Can anyone point me toward a solution for persisting non-controls (i.e.: a
stack) across PostBacks?

TIA!
- Warren
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You can put pretty much anything, as long as it's Serializable, in the
page's ViewState and then retrieve it after a postback:

ViewState["Thing"] = myThing;
// later after postback...
myThing = (Thing)ViewState["Thing"];

There's some overhead associated with this because the ViewState is
downloaded as part of the page's html and uploaded again as part of the
request. If it's a large object you're better off saving it in the Session.

-Jason

Warren J. Hairston wrote:
Can anyone point me toward a solution for persisting non-controls (i.e.: a
stack) across PostBacks?

TIA!
- Warren

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.