Solved

Persisting Dynamically Created controls across Postback C#

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

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This video discusses moving either the default database or any database to a new volume.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now