Dynamic forms with input boxes added at run time.

Discussion in 'ASP .Net' started by =?Utf-8?B?QXJuZSBHYXJ2YW5kZXI=?=, Oct 5, 2007.

  1. I am programming input forms in Asp.net 2.0
    Some textboxes are static on the form and viewstate works fine.
    Some textboxes have to be dynamically added to the form at run-time which
    makes viewstate difficult to maintain. Sometimes I have got viewstate to
    magically work. Sometime I have to manually restore viewstate.
    What is the best way to deal with dynamically created input boxes?

    --
    Arne Garvander
    Certified Geek
    Professional Data Dude
    =?Utf-8?B?QXJuZSBHYXJ2YW5kZXI=?=, Oct 5, 2007
    #1
    1. Advertising

  2. Whenever a page posts back, you must recreate any dynamically added controls
    and ensure they have the same ID property they had when you first created
    them.
    Setting EnableViewState to true helps too.
    -- Peter
    Recursion: see Recursion
    site: http://www.eggheadcafe.com
    unBlog: http://petesbloggerama.blogspot.com
    BlogMetaFinder: http://www.blogmetafinder.com



    "Arne Garvander" wrote:

    > I am programming input forms in Asp.net 2.0
    > Some textboxes are static on the form and viewstate works fine.
    > Some textboxes have to be dynamically added to the form at run-time which
    > makes viewstate difficult to maintain. Sometimes I have got viewstate to
    > magically work. Sometime I have to manually restore viewstate.
    > What is the best way to deal with dynamically created input boxes?
    >
    > --
    > Arne Garvander
    > Certified Geek
    > Professional Data Dude
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Oct 5, 2007
    #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. Alessandro Zifiglio
    Replies:
    0
    Views:
    407
    Alessandro Zifiglio
    Feb 10, 2004
  2. Stefan Mueller
    Replies:
    5
    Views:
    12,359
    jamesxa
    Jun 16, 2009
  3. Matthew Wilson
    Replies:
    6
    Views:
    292
    Nick Vatamaniuc
    Jul 20, 2006
  4. Pierre Yves
    Replies:
    2
    Views:
    475
    Pierre Yves
    Jan 10, 2008
  5. Immortal Nephi
    Replies:
    3
    Views:
    663
    James Kanze
    Dec 23, 2009
Loading...

Share This Page