troubleshooting Question

Custom WebControl and State Managent of Dymanicly Added Controls

Avatar of hedgedevelopers
hedgedevelopers asked on
.NET ProgrammingC#ASP.NET
3 Comments1 Solution249 ViewsLast Modified:
I want to build a custom server control (WebControl) that has a collection of business objects (Investors) as a public property. What I want to have happen is on the page level I set the collection equal to a collection retrieved from the database and then I call a public function (Build) on the user control.

When Build executes it iterates through the collection of Investors and adds textbox controls to the Controls collection. My problem is is that I keep losing these controls on postback. I need to have these controls and their values be maintained across postbacks and I can't figure out how to do this with dynamically added controls NOT templated controls.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros