<p>On my journey into the depths of custom ASP.NET control development I am obviously getting my head around the ASP.NET PostBack model and how it affects control development.</p>

<p>I understand that controls have no "lifetime" in ASP.NET, and therefore must be re-initialized on each and every page load. We overcome this by persisting the objects values/parameters to the ViewState.</p>

<p>Many articles I read therefore suggest not using PostBack since this can add considerable overhead to the Page. <strong>I am not looking for how to disable it, I know that.</strong> </p>

<p>What I am looking for is:</p>

<p><strong>What alternatives to we have to using the PostBack model to initialize controls?</strong></p>

<p>I know we <em>could</em> use the QueryString, but that seems awfully messy, and obviously unreliable.</p>

<p><strong>Ideally you could give me an overview of the architecture/design of a different approach and the pro's/con's of it..</strong></p>

<p>Many thanks ^_^</p>

[{'answer_id': 75859, 'author': 'Greg Hurlman', 'author_id': 35, 'author_profile': 'https://Stackoverflow.com/users/35', 'pm_score': 3, 'selected': True, 'text': "<p>Well, Session State is a server-side solution, with its own pile of cruft to deal with if you want to avoid ViewState altogether.  Really though, using ViewState in a custom control is all fine and good - just be picky about what you store - only store deltas from the declared control state, don't store anything you're going to get on postback anyway (e.g. from a DB call), etc.</p>\n"}, {'answer_id': 75869, 'author': 'Eric Z Beard', 'author_id': 1219, 'author_profile': 'https://Stackoverflow.com/users/1219', 'pm_score': 1, 'selected': False, 'text': "<p>You have to store the values somewhere, so you are limited to the query string and hidden form fields.  If you relate that to HTTP, basically it's either GET or POST parameters.</p>\n\n<p>I suppose you could use cookies, but that would be really messy.</p>\n"}, {'answer_id': 75871, 'author': 'mdb', 'author_id': 8562, 'author_profile': 'https://Stackoverflow.com/users/8562', 'pm_score': 1, 'selected': False, 'text': '<ol>\n<li><p>Store your object state in the session context: this will shift the burden of keeping state from the client to the server, which <em>may</em> be acceptable for small-scale intranet apps. For sites on the capital-I Internet, this won\'t work;</p></li>\n<li><p>AJAX-enable your control: in this case, only state <em>changes</em> need to be posted back. Picking the right framework is key here; see <a href="http://www.asp.net/ajax/ajaxcontroltoolkit/samples/" rel="nofollow noreferrer">http://www.asp.net/ajax/ajaxcontroltoolkit/samples/</a> for the official MS approach; many others are possible.</p></li>\n</ol>\n'}, {'answer_id': 75878, 'author': 'Joel Coehoorn', 'author_id': 3043, 'author_profile': 'https://Stackoverflow.com/users/3043', 'pm_score': 0, 'selected': False, 'text': '<p>I think you still mis-understand controls somewhat.  Controls only have the problem you describe when you add them to the page dynamically.  If you declare your controls upfront in the aspx code then they build along with the page.</p>\n'}, {'answer_id': 235983, 'author': 'sliderhouserules', 'author_id': 31385, 'author_profile': 'https://Stackoverflow.com/users/31385', 'pm_score': 1, 'selected': False, 'text': "<p>If you're truly looking for alternatives to the PostBack model altogether, then I would suggest researching the ASP.NET MVC Framework. I would love to kick WebForms to the curb and do all my stuff in MVC, but alas, legacy code is a tarbaby and rewriting is almost never the answer, so I plug onwards...</p>\n"}]
['https://Stackoverflow.com/questions/75805', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/832/']