471,090 Members | 1,609 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,090 software developers and data experts.

Preserving POSTBACK data on dynamically added textboxes


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

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 1406

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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.