Solved

Persisting Dynamically Created controls across Postback C#

Posted on 2008-10-22
2
439 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

821 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