468,766 Members | 1,330 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,766 developers. It's quick & easy.

Preserving POSTBACK data on dynamically added textboxes

Hi,

The problem I cannot seem to solve:

I have a page with a button control. In the On_Click eventhandler I
dynamically add one TextBox each time the button is clicked. I add the
textboxes to an update panel. I store the ID for the generated
textboxes in the Viewstate, which I use in the Panels' INIT
eventhandler to go ahead and instantiate the textboxes once again
every postback. I use the, in my opinion, old mechanism of retreiving
the textbox data by using the Request.Form[] indexer, indexing into
the collection using the textbox ID's stored in viewstate.

I know that there is the mechanism of re-loading postbackdata in the
freshly generated page class every postback. I know this happens after
the pages' control tree is rebuilt during the OnInit event of the page
itself.

My question: When I remove the Request.Form[] mechanism from my
panel_OnInit eventhandler, the filled in text in every textbox goes
lost on every postback. Can anyon tell me how to automatically re-fill
the generated textboxes(during Panel_OnInit) with the postback data
from the request ?

Many Thanks!!

Sep 17 '08 #1
0 1346

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Matthew Smith | last post: by
5 posts views Thread by John Cosmas | last post: by
10 posts views Thread by Krista Lemieux | last post: by
13 posts views Thread by Chris Thunell | last post: by
reply views Thread by 1388-2/HB | last post: by
1 post views Thread by Joe Abou Jaoude | last post: by
4 posts views Thread by =?Utf-8?B?RHlsYW5TbWl0aA==?= | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.