Retaining dynamic controls on postback

Discussion in 'ASP .Net' started by mirin, Mar 3, 2008.

  1. mirin

    mirin Guest

    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
    mirin, Mar 3, 2008
    #1
    1. Advertising

  2. "mirin" <> wrote in message
    news:...

    > 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
    Mark Rae [MVP], Mar 3, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?ZGVuIDIwMDU=?=
    Replies:
    3
    Views:
    636
    =?Utf-8?B?ZGVuIDIwMDU=?=
    Mar 12, 2007
  2. David Bowey
    Replies:
    2
    Views:
    194
    Nick Stansbury
    Apr 5, 2005
  3. Etrast

    Dynamic Template Column - retaining value on postback

    Etrast, Jun 17, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    314
    Tim_k
    Jun 30, 2004
  4. Etrast

    Dynamic Template Column - retaining value on postback

    Etrast, Jun 17, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    218
    Andy Z Smith
    Jun 17, 2004
  5. David Bowey
    Replies:
    2
    Views:
    197
    Nick Stansbury
    Apr 5, 2005
Loading...

Share This Page