What's the official Microsoft way to track counts of dynamic controls to be reconstructed upon Postback?

Posted by John K on Stack Overflow See other posts from Stack Overflow or by John K
Published on 2010-12-21T06:31:10Z Indexed on 2010/12/21 7:54 UTC
Read the original article Hit count: 294

Filed under:
|
|
|

When creating dynamic controls based on a data source of arbitrary and changing size, what is the official way to track exactly how many controls need to be rebuilt into the page's control collection after a Postback operation (i.e. on the server side during the ASP.NET page event lifecycle) specifically the point at which dynamic controls are supposed to be rebuilt? Where is the arity stored for retrieval and reconstruction usage?

By "official" I mean the Microsoft way of doing it. There exist hacks like Session storage, etc but I want to know the bonafide or at least Microsoft-recommended way. I've been unable to find a documentation page stating this information. Usually code samples work with a set of dynamic controls of known numbers. It's as if doing otherwise would be tougher.

Update: I'm not inquiring about user controls or static expression of declarative controls, but instead about dynamically injecting controls completely from code-behind, whether they be mine, 3rd-party or built-in ASP.NET controls.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about controls