Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Persisting Dynamically Created controls across Postback C#

Posted on 2008-10-22
2
Medium Priority
?
445 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 2000 total points
ID: 22780778
0
 
LVL 13

Author Comment

by:copyPasteGhost
ID: 22781256
Nice!
thanks!
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Integration Management Part 2
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

885 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