retrieve dynmatic control values

Discussion in 'ASP .Net' started by nic, Nov 5, 2003.

  1. nic

    nic Guest

    Hi,
    I have an aspx page where I dynamically generate a number
    of input controls. Upon submitting the form I need to re-
    create the controls in order to retrieve their values. I
    understand this, but I'm confused on how the newly
    generated control and the previous control (before
    postback) can share the same value (I'm glad it works but
    I don't see how).

    I also noticed I need to re-create the control in the
    Page_Load event. If I create it in a later event (i.e. in
    some method called by an onClick event) the form values
    can not be retrieved.

    When is the best time to recreate the control and how does
    it work?

    Thanks
    nic, Nov 5, 2003
    #1
    1. Advertising

  2. Hi

    > I have an aspx page where I dynamically generate a number
    > of input controls. Upon submitting the form I need to re-
    > create the controls in order to retrieve their values. I
    > understand this, but I'm confused on how the newly
    > generated control and the previous control (before
    > postback) can share the same value (I'm glad it works but
    > I don't see how).


    The viewstate allows you to reload the values, however
    , to every postback, you must always have recreated the same controls with
    the same characteristics!

    > I also noticed I need to re-create the control in the
    > Page_Load event. If I create it in a later event (i.e. in
    > some method called by an onClick event) the form values
    > can not be retrieved.
    >
    > When is the best time to recreate the control and how does
    > it work?


    The best time to recreate the control is in the "Init" Event so the
    ViewState is correctly loaded.

    Ciao
    Giorgio
    Giorgio Parmeggiani, Nov 5, 2003
    #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. Mark
    Replies:
    0
    Views:
    779
  2. balamurukan

    How to retrieve child properties values

    balamurukan, Nov 28, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    300
    balamurukan
    Nov 28, 2003
  3. Joerg Jooss
    Replies:
    1
    Views:
    1,162
    =?Utf-8?B?RXJpayBKZW5zZW4=?=
    Sep 21, 2004
  4. =?Utf-8?B?RXJpayBKZW5zZW4=?=

    Retrieve Form Key-Values from HttpWebResponse

    =?Utf-8?B?RXJpayBKZW5zZW4=?=, Sep 21, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    367
    =?Utf-8?B?RXJpayBKZW5zZW4=?=
    Sep 21, 2004
  5. Replies:
    3
    Views:
    213
    Alessandro Zifiglio
    Aug 2, 2006
Loading...

Share This Page