Q:

ASP.Net Control.OnInt and HttpContext

I'm digging around with HttpContext and the OnInit event for a custom control, after realizing that a few checks are not responding in the desired manner.
Within the current context's items collection, I store an object (serialized) that I would like to interrogate once on every post back. The first time the control is rendered, will the items[] be null, it then gets populated somewhere down the line and the user clicks a button to post back data.
Now, within the button submit event, I set the items[key] to null to ensure that on the post back I don't have anything stored, but it always contains a value.
I'm assuming that the OnInit handler has a reference to the previous state, thus 'falsely' assuming that the items[] should contain a value. Is this something to do with the way OnInit works, or am I missing the bigger picture?
Thanks,
Eric

A:

Items is not persisted across requests. From the initial request to the postback request, that represents two distinct request lifecycles between the client and server, and two separate instances of Items. Persisting data across requests requires using Session, Cache, or ViewState.

