Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Retaining dynamic controls on postback

Reply
Thread Tools

Retaining dynamic controls on postback

 
 
mirin
Guest
Posts: n/a
 
      03-03-2008
Respected Gurus,

In my aspx page, I have a treeview control to which nodes and branches
are dynamically added based on user action. Each time the page is
submitted, the treeview remembers what node was added last and renders
it correctly. All of which is fine.

Now I have an asp table to which x number of rows are added
dynamically based on user query. Each row consists of an unbound
checkbox, an unbound text box and an unbound dropdownlist with values
fetched from a database. Now, on the click of a button I need to get
the values updated by the user for each row and perform some action
programatically. But the problem, as you might have guessed, is that
the dynamically added controls disappear on submit and hence no action
can be performed using the control values. Now I know that in order to
retain the controls and their values, I need to somehow keep track of
their properties and recreate them each time on postback. But I was
wondering whether there is any table or control similar to the
treeview control which could remember the child controls that have
been dynamically added to it? Or is there any trick I could employ
other than recreating the dynamic controls on each postback?

Many thanks,
Mirin
 
Reply With Quote
 
 
 
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      03-03-2008
"mirin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> Or is there any trick I could employ other than recreating the dynamic
> controls on each postback?


Not that I know of...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem retaining values of dropdownlist controls after postback =?Utf-8?B?ZGVuIDIwMDU=?= ASP .Net 3 03-12-2007 06:52 AM
Adding a Dynamic User Control from the Base Page Class (and retaining it on Postback?) David Bowey ASP .Net Building Controls 2 04-05-2005 08:17 AM
Adding a Dynamic User Control from the Base Page Class (and retaining it on Postback?) David Bowey ASP .Net Web Controls 2 04-05-2005 08:17 AM
Dynamic Template Column - retaining value on postback Etrast ASP .Net Web Controls 1 06-30-2004 03:55 PM
Dynamic Template Column - retaining value on postback Etrast ASP .Net Web Controls 1 06-17-2004 10:57 PM



Advertisments