Dynamically created controls not refreshed

Discussion in 'ASP .Net' started by Dwight Johnson, Oct 19, 2007.

  1. I am building a website in VS2005. I basically have one page,
    default.aspx, which contains placeholder objects into which I add
    various controls that are dynamically created. I have a dropdownlist
    that is created in the InitializeComponent event so I can do a
    FindControl on it later to determine its new value when it is
    selected. Based on this new value I will then get data from a database
    and fill another placeholder on the page with a dynamically built
    table containing labels and textboxes filled with the new data. This
    process happens in the Page_Load, regardless of the state of
    IsPostBack. When I debug the process, the dynamically-created controls
    are all populated with the new data, but when the page appears, the
    only data I ever see is the data from the first time that the page
    loaded. Any ideas? I have done this same thing in VS2003 without a
    problem. I'm completely baffled by this one.
    Dwight Johnson, Oct 19, 2007
    #1
    1. Advertising

  2. Just to clarify, I added a dropdownlist to the group of textboxes, and
    the dropdown list always reflects the new data (?!) while the
    textboxes remain unchanged.

    Also, the new data appears in the textboxes when I return to the page
    using a link on the page with a different querystring, but not when I
    do an autopostback on the original dropdownlist that determines which
    set of data is loaded into the page.

    Is any of this making any sense to anyone?
    Dwight Johnson, Oct 19, 2007
    #2
    1. Advertising

  3. One more thing. When I made the textboxes ReadOnly = true, they all
    get refreshed!

    The good news is, my problem is solved.
    The bad new: I still have no idea why.
    Dwight Johnson, Oct 19, 2007
    #3
    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. Tim Greenwood
    Replies:
    1
    Views:
    860
    Teemu Keiski
    May 13, 2005
  2. Amelyan
    Replies:
    2
    Views:
    681
    Amelyan
    Nov 5, 2005
  3. msimmons
    Replies:
    0
    Views:
    472
    msimmons
    Jul 16, 2009
  4. John Sewell

    Dynamically Created User Controls not Initialising

    John Sewell, Sep 3, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    119
    Jeffrey Palermo [MCP]
    Sep 5, 2004
  5. Xaroth
    Replies:
    1
    Views:
    196
    Robert Burks
    Jan 12, 2005
Loading...

Share This Page