Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

Retaining dynamic controls on postback

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mirin - 03 Mar 2008 11:29 GMT
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
Mark Rae [MVP] - 03 Mar 2008 12:53 GMT
> Or is there any trick I could employ other than recreating the dynamic
> controls on each postback?

Not that I know of...

Signature

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


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.