Dynamically created Datagrid not found on postback

Discussion in 'ASP .Net' started by Jeff User, Nov 15, 2006.

  1. Jeff User

    Jeff User Guest

    Hi all
    I need to create datagris dynamically in C# code.
    I placed a PlaceHolder object on my form and then as Datagrids are
    created, they are added to the PlaceHolder. This works and display
    well but on postback, my PlaceHolder object has no controls.i.e.
    PlaceHolder1.Controls.Count is 0
    I can determine the IDs of the grids created which allows me to use
    FindControl, but FindControl also does not find them.

    One of the columns in the grids is a textbox that the user fills in a
    number. I need to capture this number (if entered).

    Some article state that the controls need to be re-created on
    postback. How do I do this, without losing the values that the user
    filled in? When I recreate the same grid controls again, the new text
    boxes are empty (of course).
    Thanks
    Jeff
    Jeff User, Nov 15, 2006
    #1
    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. martin
    Replies:
    1
    Views:
    745
    avnrao
    May 14, 2004
  2. CS Wong
    Replies:
    1
    Views:
    2,847
    Jeffrey Palermo [MCP]
    Oct 29, 2004
  3. Tim Greenwood
    Replies:
    1
    Views:
    860
    Teemu Keiski
    May 13, 2005
  4. msimmons
    Replies:
    0
    Views:
    470
    msimmons
    Jul 16, 2009
  5. Tim Greenwood

    HELP!! Dynamically created webcontrol not accessible on postback

    Tim Greenwood, May 12, 2005, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    165
    Brock Allen
    May 19, 2005
Loading...

Share This Page