Solved

Persisting Dynamically Created controls across Postback C#

Posted on 2008-10-22
2
437 Views
Last Modified: 2013-12-17
I have a series of textboxes. I don't know many there are going to be so I'm creating them dynamcially.

I have 4 sections on my page. Each within Divs that hide and show one another, when buttons are pressed.

On the 3rd div I have the dynamcially loaded text boxes..

I've read that I need to create the textboxes, in the OnInit method of the page.
I try doing that.
The problem is I need a value from one section (the number of boxes to create) to actually build the textboxes. I tried putting it into a httpContext, Viewstate, and session. the problem is still the same...the Oninit executes first so it never gets my values. Since it never gets my values it never creates the boxes...

I need these boxes created and then when changed I need to update my database with the changed values. (Thus the reason why I need OnInit to create them. so that they stay there so I can use it doing the load process.)

I hope that is clear.

Any help would be great!
thanks,
Josh
0
Comment
Question by:copyPasteGhost
2 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 22780778
0
 
LVL 13

Author Comment

by:copyPasteGhost
ID: 22781256
Nice!
thanks!
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question